LeetCode Unique Email Addresses Solution Explained - Java

Sdílet
Vložit
  • čas přidán 7. 03. 2019
  • The Best Place To Learn Anything Coding Related - bit.ly/3MFZLIZ
    Join my free exclusive community built to empower programmers! - www.skool.com/software-develo...
    Preparing For Your Coding Interviews? Use These Resources
    --------------------
    (My Course) Data Structures & Algorithms for Coding Interviews - thedailybyte.dev/courses/nick
    AlgoCademy - algocademy.com/?referral=nick...
    Daily Coding Interview Questions - bit.ly/3xw1Sqz
    10% Off Of The Best Web Hosting! - hostinger.com/nickwhite
    Follow My Twitter - / nicholaswwhite
    Follow My Instagram - / nickwwhite
    Other Social Media
    ----------------------------------------------
    Discord - / discord
    Twitch - / nickwhitettv
    TikTok - / nickwhitetiktok
    LinkedIn - / nicholas-w-white
    Show Support
    ------------------------------------------------------------------------------
    Patreon - / nick_white
    PayPal - paypal.me/nickwwhite?locale.x...
    Become A Member - / @nickwhite
    #coding #programming #softwareengineering
  • Věda a technologie

Komentáře • 6

  • @behold_a_son
    @behold_a_son Před 2 lety

    Shouldn't it be String domain_name = email.substring(split_position +1) to start ahead of the '@'? It did not make a difference though, apparently.

  • @WalkWithM3
    @WalkWithM3 Před 4 lety +4

    Nice explanation

  • @Gideon_Judges6
    @Gideon_Judges6 Před 4 lety +1

    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.

    • @jordanhanley7585
      @jordanhanley7585 Před 3 lety +1

      yeah technically but the time complexity wouldn't change, so an interviewer wouldn't care

  • @faizankhan-mh5uj
    @faizankhan-mh5uj Před 4 lety

    too much of inner loops ?