LeetCode Unique Email Addresses Solution Explained – Java
LeetCode Unique Email Addresses Solution Explained – Java
FOLLOW ME BELOW
Patreon – https://www.patreon.com/nick_white?al…
Twitch – https://www.twitch.tv/matrixman
Reddit – https://www.reddit.com/r/NickWhiteCod…
Twitter – https://twitter.com/nickdoubleyouu
Instagram – https://instagram.com/nickdoubleyou
Linkedin – https://www.linkedin.com/in/nicholas-…
Github – https://github.com/white105
Discord – https://discordapp.com/invite/vQH4vSJ
Soundcloud – https://soundcloud.com/nickiswhite
too much of inner loops ?
At line 11 where you do .contains and then .indexOf, you’re scanning the string twice. Instead you can just do the indexOf and if it’s not -1 then do the substring on that index. That should be slightly better perf in those cases.
Nice explanation