Leetcode 1. Two Sum [3 approaches]

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024

Комментарии • 69

  • @anushreevirtualgaming226
    @anushreevirtualgaming226 2 года назад +5

    for the same 1st brute force I got :
    Runtime: 416 ms, faster than 35.24% of C++ online submissions for Two Sum.
    Memory Usage: 10.3 MB, less than 75.73% of C++ online submissions for Two Sum.
    So , never get disappointed (it is heavily dependant on server response+ interenet connectivity)

  • @travelnlearn
    @travelnlearn 2 года назад +5

    Thank You Sir for this awesome and genuine content.
    This q looked difficult to me before but now its a piece of cake for me.
    All thanks to you Sir, May GBU with lots of love long life success happiness and enjoyment
    Thanks a lot again

  • @VivekKumar-ru8ur
    @VivekKumar-ru8ur 2 года назад

    Line 6: Char 18: error: too few template arguments for class template 'pair'
    vector v;
    ^
    /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_iterator.h:1286:12: note: template is declared here
    struct pair;
    ^
    this error getting using PAIR

  • @992_anisharoy9
    @992_anisharoy9 2 года назад +2

    Please share the previous video links

  • @pratiyushkejriwal5736
    @pratiyushkejriwal5736 2 года назад +2

    which previous videos you are talking about here....I tried to find but I couldn't

  • @riyagusain3439
    @riyagusain3439 Год назад

    in case of Maps why we are using m.end() ? why we are comparing it to the end element of map?

  • @harshtyagi895
    @harshtyagi895 3 года назад +3

    at 2:07 I think indices 1,8 can also be the answer

  • @kunalkoyande1963
    @kunalkoyande1963 2 года назад +5

    Great explanation Sir......Thank you for the video
    At 1:20 you told in the video that watch the previous video...
    Please give a link to the previous video of tools and everything else to solve the problems

  • @shubhibajpai4298
    @shubhibajpai4298 11 месяцев назад

    Sir which previous video you are talking here..i couldn't find that video

  • @prakashdhyani524
    @prakashdhyani524 2 года назад +1

    My o(n) approach -> in for loop, create a string and keep inserting the current index value if it doesnt exists in the string created so far. Thats it.
    For explaination, you can DM me

  • @payalshorts6217
    @payalshorts6217 2 года назад

    U are god bro aapke videos motivate to krte hee hai

    • @payalshorts6217
      @payalshorts6217 2 года назад

      Saath saath understanding skills ko increase karne me help bhi krte hai

  • @RAMANKUMARGCEBIT
    @RAMANKUMARGCEBIT 2 года назад

    very helpful. deeply geateful.

  • @shubhibajpai4298
    @shubhibajpai4298 11 месяцев назад

    Anyone tell me which previous video sir talking

  • @bbaig1821
    @bbaig1821 3 года назад +1

    Is .first and .second is predefined?? for number and index line number 12,13??

  • @rickishere1492
    @rickishere1492 2 года назад

    much detailed solution ❤️🙏

  • @KanisFatemaShanta
    @KanisFatemaShanta Год назад +1

    2nd approach :
    if(m.find(y) != m.end())
    return (i , m[y])
    m[nums[i]] =i;
    vaiya please explain it.

  • @prateekmahajan8680
    @prateekmahajan8680 Год назад

    Hey Fraz,
    What tools you used to draw on MS Notebook, hardware specs please!

  • @soumyadipsamanta3771
    @soumyadipsamanta3771 3 года назад +3

    What is the use of the line v.push_back()?

    • @giit85
      @giit85 3 года назад

      Its insert elements in vector

  • @rekhasharma30
    @rekhasharma30 2 года назад

    which language you are using in the youtube ( C / C++ / Python) video? Difficult to understand it.

  • @anushkathakur6531
    @anushkathakur6531 Год назад

    can somebody please share the link of the previous video he is mentioning about in this video about the approaches?

  • @mgfactors3510
    @mgfactors3510 2 года назад

    19:54 thanks bhaiya

  • @akhileshgoel339
    @akhileshgoel339 Год назад

    sir not able to understand approach 2

  • @faizanahmad7227
    @faizanahmad7227 4 месяца назад

    bhai i have written the same code that u have write at time 13:54 but it give the error for the value [3,2,3] for t =6 plz reply

  • @arkur_745
    @arkur_745 2 месяца назад

    can someone explain why we took m.find(y) != m.end()

  • @paidiajay8308
    @paidiajay8308 2 года назад +2

    Fraz Sir I am new to the channel I couldn't find the previous video for this in which u have explained about the stl used for this so could u please help provide me the video links of the previous videos

  • @HimanshuSharma-oq3xg
    @HimanshuSharma-oq3xg Год назад

    where can we find the lecture which we should watch before watching this video

  • @karthikmamidishetti2528
    @karthikmamidishetti2528 3 года назад +4

    previous vidio link ??

    • @manojkumar-qm4mx
      @manojkumar-qm4mx 2 года назад

      ruclips.net/video/vAFjNEofa-g/видео.html

  • @guptaji2989
    @guptaji2989 3 года назад

    Sir time complexity of find function is O(logN)

    • @bharathkumar5870
      @bharathkumar5870 3 года назад +1

      no ro,searching key in unordered map is 0(1)

  • @sumidey1325
    @sumidey1325 2 года назад +1

    can you provide the solution in java of approach 2 and 3

  • @walkwithmanish
    @walkwithmanish 2 года назад

    Fraz i loved this video but i wish to write solution in python since i am new to python i am not able to replicate what you did in java
    how can i get some python videos

  • @RahulKumar-xl3dd
    @RahulKumar-xl3dd 2 года назад

    What is first and second over here, can any one please clarify this ???

  • @dheerajkumarbaghel9983
    @dheerajkumarbaghel9983 2 года назад

    if anyone person not understand the CPP language and he use the other language then what have to do in this case

  • @ankitkumarghosh462
    @ankitkumarghosh462 3 года назад +2

    Great explanation 🙏

  • @saurabhtripathi378
    @saurabhtripathi378 2 года назад +9

    Why these RUclipsr prefer c++ instead of java

  • @aayushojha3088
    @aayushojha3088 3 года назад +1

    pls provide the java code as well sir

  • @BcomingHIM
    @BcomingHIM 2 года назад

    in interview, if I am able to give the first and second approach and not the third one...is it fine? or do we need to know all the approaches to a problem ?

    • @JH09SUMIT
      @JH09SUMIT Год назад

      Depends on the interview level.

  • @akshaykumar192
    @akshaykumar192 2 года назад

    ye aapne kon si language me coding ki hai

  • @theyashsisodiya
    @theyashsisodiya 2 года назад

    Any here who can help me ( i can able go code but I don't understand questions) What's the solution for that !?

  • @NehaSharma-kx6hg
    @NehaSharma-kx6hg 2 года назад

    BESTTTTTTTTT

  • @tsdineshjai8565
    @tsdineshjai8565 2 года назад +1

    I don't understand why no one does this in JavaScript.

  • @jatingupta3443
    @jatingupta3443 2 года назад

    cout

  • @yashburad7350
    @yashburad7350 Год назад

    not understood hashmap logic

  • @coderecipeofficial
    @coderecipeofficial Год назад

    On a funnier note,
    Leetcode 1: Where dreams start
    .
    .
    .
    Leetcode 2: Where it ends...
    Story of most coders on leetcode 🤭

  • @shikhargupta1499
    @shikhargupta1499 2 года назад

    2nd approach wont work, in case the target is 10, it will return [8,8]

  • @coderecipeofficial
    @coderecipeofficial Год назад

    Looking for the fastest two sum solution? We have explained the two sum problem in a very simple, step by step and easy to understand way. Do checkout our videos 🙂

  • @sainhoney2004
    @sainhoney2004 Год назад

    meri english week h thodi

  • @ayushbhandari1176
    @ayushbhandari1176 2 года назад

    is this the power of god

  • @mddanishraza5482
    @mddanishraza5482 2 года назад

    Why are you speak hindi in channel but your lecture only use English that's kabhi khushi channel se mila jab aap announced kia dsa ke bare me and now kabhi gum

  • @rahuldeb61
    @rahuldeb61 2 года назад +1

    Such a bad explanation in map

    • @shreetejsanap1706
      @shreetejsanap1706 2 года назад

      No Bro, you should respect efforts! You might be unknown of the map concept.

    • @rahuldeb61
      @rahuldeb61 2 года назад +2

      Bro there is nothing related to respecting efforts. There may be 100 youtubers solving the same solution, all of them putting some effort to upload it but only few of them are able to talk clearly about the concepts I can also upload 100 dsa videos just by writting the codes. I can also put the same effort but whats the point when the viewers dont get the logic behind those codes. Channels like love babbar, striver are far way better when it comes to putting efforts.

    • @jay8118
      @jay8118 2 года назад

      @@rahuldeb61 True...Striver is the best when it comes to explanation...Every topic in minute detail...But Fraz is also good for quick revising concepts

  • @ShootOniPhone914
    @ShootOniPhone914 2 года назад +2

    Great explanation sir 🙏🙏🙏

    • @mohammadfraz
      @mohammadfraz  2 года назад

      Thanks 😊

    • @tejeshch
      @tejeshch 2 года назад

      @@mohammadfraz sir could you please make a detailed video to find time and space complexity for beginners. I can code but cannot calculate sir. please. Thanks in advance;