Challenging World's Most Selective University with Coding Question!

Поділитися
Вставка
  • Опубліковано 31 січ 2025

КОМЕНТАРІ • 258

  • @Swmdwn.Khakhlary
    @Swmdwn.Khakhlary 2 роки тому +58

    honestly, I really enjoy such content harnoor, please continue doing such type of vids. I really appreciate your effort man

  • @starboy001
    @starboy001 2 роки тому +11

    The way SHE told that why she was able to solve the 'leetcode' questions, shows us the harsh reality of being poor. Kudos woman.👍🏿👍🏿

  • @theprofessor8844
    @theprofessor8844 2 роки тому +264

    Good to see people appreciating difficulty at IITs ....

    • @rohanIVY
      @rohanIVY 2 роки тому +45

      Tho tu kyu khush ho raha

    • @abhijeetsingh4824
      @abhijeetsingh4824 2 роки тому

      @@rohanIVY INKO IIT ME NAUKRI LAGA HAI. JANITOR KA

    • @akashpaul4143
      @akashpaul4143 2 роки тому +15

      @@rohanIVY dikhai nahi deta woh professor hai !!🙂🥲

    • @theprofessor8844
      @theprofessor8844 2 роки тому +6

      @@rohanIVY Because I was at one point involved in studying for these institutes. I understand how hard it is to get in.

    • @hippityhoppity3964
      @hippityhoppity3964 2 роки тому +8

      @@akashpaul4143 Bhai phir toh muje kal paaka asli Willi smith ne comments meh gaali di

  • @tebooo_n
    @tebooo_n 2 роки тому +8

    Please make more videos like this 🥹 really enjoy watching them. Very insightful

  • @atmangautham7078
    @atmangautham7078 2 роки тому +28

    I’m loving this series of asking questions to top College students❤

  • @mohitmishra3091
    @mohitmishra3091 2 роки тому +5

    bhai indians hi indians dikh rahe sab jagh..hahah..its like u r in dilli sarijini nagar..so happy seeing indian roots at all places !!

  • @goodhuman1
    @goodhuman1 2 роки тому +3

    All of these videos are so good, especially at Stanford and with the Meta guy!!

  • @shachisinghal8856
    @shachisinghal8856 2 роки тому +5

    Keep posting such videos. They are very inspiring.

  • @joelmarkjmj
    @joelmarkjmj 2 роки тому +8

    We want this type of content More and More and Most

  • @MLRTrytonix13
    @MLRTrytonix13 2 роки тому +12

    For the second problem I'm actually surprised the first guy didn't have a clue of the most efficient way. I'm a CS Junior and one of my first class last semester was about assembly. It helped me so much with the understanding of problems like these.

    • @eduardocod8924
      @eduardocod8924 Рік тому +11

      Yeah but after 3 months you’ll forget it 😂

  • @aanifshabir1554
    @aanifshabir1554 2 роки тому +61

    14:03 best part 😂

  • @yash9725
    @yash9725 8 місяців тому

    # One of the better ways to find if the number is a power of 2:-
    #include
    using namespace std;
    bool f(int n)
    {
    if(n == 0)
    {
    return false;
    }
    int count = 0;
    while((n & 1) == 0) // when the lsb is set the loop stops.
    {
    count++;
    n >>= 1;
    }
    if(n == 1)
    {
    return true;
    }
    return false;
    }
    int main()
    {
    int n = 16;
    cout

  • @raghavchhabra5951
    @raghavchhabra5951 2 роки тому +43

    Everytime I watch his video, I start doing leetcode for a week and then stop. 😂

    • @rohanIVY
      @rohanIVY 2 роки тому

      Relatable😂

    • @boy0607boy
      @boy0607boy 2 роки тому

      @@rohanIVYhow do you decide on the list of problems?

    • @redhair1401
      @redhair1401 2 роки тому +1

      @@boy0607boy no. Of likes on the problem

    • @dokyungsoo8623
      @dokyungsoo8623 2 роки тому

      Me tooo

    • @dark_techyy
      @dark_techyy Рік тому

      Let me take your mock interview if you are still alive!😊😂

  • @swarupbehera6806
    @swarupbehera6806 2 роки тому +5

    x=int(input(enter the no;))
    y=x/2
    if y==x//2 :
    print("is a power of 2")
    maybe the second question cqn be solved like this

    • @Sanyu-Tumusiime
      @Sanyu-Tumusiime 2 роки тому +1

      why bother doing that? just use bitwise to solve it
      public static void main(String[] args){
      int x = [INPUT];
      int ct = 0;
      while(x > 0){
      if(x & 1 == 1){
      ct ++;
      x >>= 1;
      }
      if(ct == 1) System.out.println("is a power of 2");
      else System.otu.println("not a power of 2");
      }
      very easy

    • @swarupbehera6806
      @swarupbehera6806 2 роки тому

      @@Sanyu-Tumusiime that seems more hard though 😅😅🤣🤣

    • @Vvarsha007
      @Vvarsha007 2 роки тому

      Hey yours will be wrong as for ex of we take 12 it will return 6 and 12//2 also returns 6 even though they are same we know that 12 is not a power of 2

    • @Sanyu-Tumusiime
      @Sanyu-Tumusiime 2 роки тому

      @@Vvarsha007 you're right. it will be wrong. use my solution

    • @swarupbehera6806
      @swarupbehera6806 2 роки тому

      @@Vvarsha007 you are absolutely correct ma'am and i agree as now I can see I am purely wrong there btw I started to learn programming 3 months ago so no hardships 😁
      Let's see what this world has to offer for me 😌

  • @raghavgujjar
    @raghavgujjar 2 роки тому +19

    The O(1) solution is limited by the address space of the registers in the CPU and ALU. So for very large powers of two, like above 2^64 it may not be as efficient. Depends on how many bits the registers can store. Disclaimer: This is just thought aloud. Might need more verification.

  • @jaycen1856
    @jaycen1856 2 роки тому +1

    This is just a pure understanding of how binary operations work…. Nothing too technical on algorithm.

  • @furiousbro4685
    @furiousbro4685 2 роки тому +8

    This students are quite intellegent .

    • @neon-astronaut
      @neon-astronaut 2 роки тому +2

      Bhai won Stanford hai
      Wahan to honge hi

  • @Fahadgermany7
    @Fahadgermany7 2 роки тому +5

    Stanford Universities not all students r as briliant as iitians
    As 40-50% goes to iit due to their social activities in international level

  • @vision_lc
    @vision_lc 2 роки тому +25

    He never stop to motivate people 🥺

  • @mohitchoudhary3668
    @mohitchoudhary3668 2 роки тому +17

    Honestly i enjoy the series It's great to know the foreign students how they study in college and what apporch they think 💬. And sir one request is there , can you make a video for Bca students . How they can start to do coding and after doing bca they should do masters for multinational companies . And for multinational companies only coding is important or any more thing we have to study. Because we are learning basic things of coding . And one more thing i am noob in coding so how can i start coding can you explain in video or reply here . And for coding you can prefer any book .

  • @Asherstitusworld
    @Asherstitusworld 2 роки тому +3

    Super video Bro Nice Intro

  • @muditkhanna8164
    @muditkhanna8164 Рік тому +2

    the solution you just gave for was very creative for checking the power of the two , but after that the more simple answer would've been just checking the LSB of that binary number

  • @HungryWTF
    @HungryWTF 2 роки тому +29

    bro that string question is cake walk level 😂

  • @Piggynmoo
    @Piggynmoo Рік тому +3

    My son is doing CS from UTS in sydney and Its my dream to see him get his masters from MIT.

  • @lostgoat
    @lostgoat 2 роки тому +1

    8:00 return n & (n-1) == 0

  • @mrd6840
    @mrd6840 2 роки тому +3

    Hey bro I need more videos like mit students solving iit question paper and iit students as same as mit question paper. Need from you

  • @AbhishekSingh0216
    @AbhishekSingh0216 2 роки тому +301

    Their names were Sanjay,Sahil & saurav and they were not from India🙃.even foreigners give Indians name to their children.

    • @sxmeersharma
      @sxmeersharma 2 роки тому +208

      They are from Indian origin not Indian their parents are probably 2nd Gen Immigrants

    • @mrkiba1781
      @mrkiba1781 2 роки тому +19

      @@sxmeersharma Sahil from Bangladesh

    • @sxmeersharma
      @sxmeersharma 2 роки тому +22

      @@mrkiba1781 it’s a common name in both countries he could be even Pakistani

    • @arnavD007
      @arnavD007 2 роки тому +2

      I guess they are OCI's

    • @mrkiba1781
      @mrkiba1781 2 роки тому +6

      @@sxmeersharma he is my relative, don't claim anyone Indian origin

  • @__T-T__
    @__T-T__ 2 роки тому +6

    8:45 here's my solution, Please tell me is this a good solution (I am just a beginer)
    counter = 0
    a = int(input("enter any no."))
    b=a
    while True:
    if b%2==0:
    counter += 1
    b = b/2
    else:
    break
    if (2**counter)==a:
    print("True")
    else:
    print("False")

  • @jasdeepsinghgrover2470
    @jasdeepsinghgrover2470 2 роки тому +4

    BTW all these solutions are actually correct... The full adder circuit is itself O(number of bits) so subtracting 1 takes O(number of bits which is same as number of digits)

    • @ziedbrahmi4812
      @ziedbrahmi4812 2 роки тому

      mm not really , it's more efficient because it's a native thing for the processor.

    • @jasdeepsinghgrover2470
      @jasdeepsinghgrover2470 2 роки тому

      @@ziedbrahmi4812 but it is still under the assumption that number fits in the circuits

  • @mrd6840
    @mrd6840 2 роки тому +2

    I need this kind of videos more ...

  • @rahuliitbhu3111
    @rahuliitbhu3111 2 роки тому +1

    good job , keep it up.

  • @thankyou_guruji
    @thankyou_guruji 2 роки тому +11

    Aryender is doing such an amazing job as Harnoor's new partner! Also giving away 100 or 50 USD to these students who can afford leetcode premium doesn't makes much sense! Why don't you give your Indian subscribers a question who can't afford leetcode premium?

  • @tripcreator87
    @tripcreator87 Рік тому

    Admission in IIT is much tougher than MIT, People like you who not able to clear JEE moved to US/UK for further degree course.

    • @bluedevil5612
      @bluedevil5612 Місяць тому

      First go see selection process of these college then talk

  • @yash9725
    @yash9725 8 місяців тому

    # Adding 2 Binary Strings:-
    #include
    using namespace std;
    string bin(string &s1,string &s2)
    {
    int i = s1.size() - 1;
    int j = s2.size() - 1;
    int carry = 0;
    string res = "";
    while(i >= 0 || j >= 0 || carry)
    {
    int n1 = (i >= 0) ? s1[i] - '0' : 0;
    int n2 = (j >= 0) ? s2[j] - '0' : 0;
    int sum = n1 + n2 + carry;
    carry = sum / 2;
    res.insert(res.begin(),(sum % 2) + '0');
    i--;
    j--;
    }
    return res;
    }
    int main()
    {
    string s1 = "101";
    string s2 = "0010";
    cout

  • @THE_GFI
    @THE_GFI Рік тому

    This is good content bro but please post the selected question or any question to solve for the viewers ✌

  • @shauryakansal1081
    @shauryakansal1081 2 роки тому +1

    thanks for everything!

  • @aritano491
    @aritano491 Рік тому +1

    For the power of 2 one you can just do log(number)/log(2) and if its an int then you know the number has a base of 2. However, I may have also misunderstood the question lol.

  • @masudahmed5196
    @masudahmed5196 2 роки тому +1

    Wow awesome 👌
    Appreciating for Last girl 👧

  • @indrashispowali
    @indrashispowali 2 роки тому

    Maja e aa gaya vlog dekh ke toh

  • @pritikahanda7709
    @pritikahanda7709 2 роки тому +2

    i learnt whole of this binary system in grade 10th and after joining coaching institute it all went to vein due to extreme pressure of examsss

  • @dakshbhatnagar
    @dakshbhatnagar 2 роки тому +1

    I thought MIT < Stanford. Anyways bro you got to get a dedicated mic since the device is picking up sounds of the background as well

  • @fredericnoa-jy2ui
    @fredericnoa-jy2ui Рік тому

    For powers of 2 Idk
    bool is_power_of_two(int number) {
    return number > 0 && (number & (number - 1)) == 0;
    }
    Could someone check please 10:31 10:32 10:35

  • @liontalha7383
    @liontalha7383 Рік тому

    And me thinking the optimal solution for power of 2 => (ceil(log2(n)) == floor(log2(n)))

  • @kirtisahani3412
    @kirtisahani3412 2 роки тому

    I really enjoy it 😀😀🙃.

  • @asisbhatrai5608
    @asisbhatrai5608 2 роки тому +1

    For checking if the number of 2 to the power of some number:
    def check(x):
    m = x/2
    while m > 1:
    m = m/2
    if m == 1:
    return True
    else:
    return False

  • @shubhanshukumarsingh6133
    @shubhanshukumarsingh6133 2 роки тому +3

    14:00 "IIT" be like Raula hai hamra , kabhi kabhi to lgta hai apun hicch bhagwan hai.

    • @mugiwara_
      @mugiwara_ Рік тому

      Still not in top 50 in global list where as MIT and Staford are in top 3

  • @Aliabdullah-o9r
    @Aliabdullah-o9r 11 місяців тому

    i am from pakistan i don`t no what an diffecult level(mean at logically level not craming ) iit take off the test but an incridble change in india education really appricated ....

  • @serenestrolls-d7b
    @serenestrolls-d7b 2 роки тому +10

    For 2 to the power n, can’t we just take base 2 log of the number. If we get an integer back. Then it’s true else it’s false. That would also be constant time. Assuming log2 function has constant time.

    • @spiderop2125
      @spiderop2125 2 роки тому +1

      Where can you get that log function from ? Not every lang is python.

    • @prabhattiwari007
      @prabhattiwari007 2 роки тому

      @@spiderop2125 exactly...That is what I was thinking

    • @yunik_developer
      @yunik_developer 2 роки тому +2

      Yeah it can be possible in Java and CPP both they have log functions

    • @manfromwuhan714
      @manfromwuhan714 2 роки тому

      They’re basically asking them to code the log function from scratch. In the most efficient way possible

  • @alphaleporis329
    @alphaleporis329 Рік тому

    12:00 *That's why I'm at Stanford not MIT*
    As if Stanford is the LPU of USA.

  • @dark_techyy
    @dark_techyy Рік тому

    I have a question for all of you.
    Q1. Given the root of a binary tree where every node contains a natural number, return the maximum path sum from node to leaf.

    • @marothee
      @marothee 10 місяців тому

      recursion

  • @draviki
    @draviki 2 роки тому

    i like your content Harnoor. Keep visiting the college

  • @thelegend5633
    @thelegend5633 2 роки тому +2

    Please make video on MIT VS STANFORD

  • @shahbazkhalilli8593
    @shahbazkhalilli8593 2 роки тому

    x="101"
    y="111"
    list=[]
    def binary(num):
    for index in range(len(num)):
    list.append(index)
    list.reverse()
    return list
    def bin_cal(daxil):
    result=0
    for index, eded in enumerate(daxil):
    eded=int(eded)
    result+=int(eded)*(2**binary(daxil)[index])
    return result
    print(bin_cal(x))

  • @ItxLittleHappiness
    @ItxLittleHappiness 8 місяців тому +1

    6:54 if a number can be written as a power of 2 then it means that it is divisible by 2 ...so I think so we can do it by simply testing as we test an even number 🥇 or not ??

  • @randym1788
    @randym1788 2 роки тому

    Non Indians wouldn't know about IIT -- some are just being polite and picking IIT as the host is Indian.

    • @tanish9381
      @tanish9381 2 роки тому

      no , they're picking IIT coz they wouldn't wanna deal with MIT's question. I would do the same if i was in their place.

  • @First533
    @First533 2 роки тому +6

    Lots of Indian names like Sanjay , sahil etc love to see Indians doing great

    • @xPhilosophyy
      @xPhilosophyy 2 роки тому +6

      Theyre from Indian parents so their descent is indian but their nationality is ig american so i don’t really think we should address them as indians

    • @First533
      @First533 2 роки тому +1

      @@xPhilosophyy i know that they are American citizen

    • @stevenayare6097
      @stevenayare6097 2 роки тому +1

      just because someone looks Indian with indian names, does not mean that person is actually an Indian

  • @shahbazkhalilli8593
    @shahbazkhalilli8593 2 роки тому

    please share the result such as valid answers of all questions at the end

  • @IMINTONIRVANA
    @IMINTONIRVANA 2 роки тому +4

    Ivy league kids are literally out of this world

  • @kislayanegi1742
    @kislayanegi1742 2 роки тому +1

    Ayender is genius!!!!

  • @shayanali7558
    @shayanali7558 2 роки тому +1

    I would have gone for;
    int a ;
    if (2 modulus a == 2) {cout

  • @pratikdharanep.d.8938
    @pratikdharanep.d.8938 2 роки тому +6

    BCA student here ❤️

  • @rahbs26
    @rahbs26 2 роки тому

    GREAT HARNOOR BRO

  • @sankalpvats4658
    @sankalpvats4658 2 роки тому

    Amazing content❣️❣️I also wanna be like you

  • @abhisheksingh402
    @abhisheksingh402 2 роки тому

    In my college out of 100 almost 99 can't solve these problems. Here almost every one have knowledge

  • @forunsecurewebsite156
    @forunsecurewebsite156 2 роки тому +1

    Question: im bad at math but i want walk in technology path, should i learn math first or codding(Frontend) but i havent decide what i want to focus with is it website or the other.

    • @TheMorhaGroup
      @TheMorhaGroup Рік тому

      I suggest sticking to your passion, if you love technology then pursue that, allow everything else to follow suit. I shall give you an example, a strategy game like Yu-Gi-Oh requires a lot of reading, however reading is not a necessity, if one has a passion in Yu-Gi-Oh, they simply need to play the game, memorising the cards they need to know, eventually memorising what words relate to what meaning, after decades of playing Yu-Gi-Oh, do you not think he would have grasped basic reading, enough to play Yu-Gi-Oh effectively? Analogous to you grasping maths, enough to be effective in the path of tech

  • @ANNGUYEN-cw7lw
    @ANNGUYEN-cw7lw 2 роки тому +1

    You can visit mission college to contest code in 5 minutes

  • @MahabirMandal-g7y
    @MahabirMandal-g7y 5 місяців тому

    sir it's good to go

  • @prodabber0222
    @prodabber0222 2 роки тому

    imagine how selectvie stanford would be if it was in washington

  • @aceit_01
    @aceit_01 2 роки тому +2

    MIT admissions process pa ek video banaow bahi

  • @kob1343
    @kob1343 2 роки тому

    Mit: if(log2(x) - round(llog2(x))==0): return True

  • @ankurpathak5964
    @ankurpathak5964 2 роки тому +1

    kuch samjah nehi aya but sunke achaa lagaa :)

  • @yahyaashraf5511
    @yahyaashraf5511 2 роки тому +1

    Please visit LAC too

  • @avocadorable18
    @avocadorable18 2 роки тому +1

    Video seems to be lagging. Anyways harnoor great content.

  • @ankurrajbangshi7133
    @ankurrajbangshi7133 2 роки тому +1

    What is Lewis Hamilton doing in Stanford??🤔

  • @redhair1401
    @redhair1401 2 роки тому +1

    Both were super easy 😉

  • @udproductions5855
    @udproductions5855 2 роки тому +1

    Mai bba ka student hu pr Mai ek code developer bna cahta hu to kya Mai bn skta hu agr bnta hu to bhi kya mujhe achi job milegi jaise ki btech walo ko milte hai

  • @harshvardhannaik1959
    @harshvardhannaik1959 2 роки тому +1

    Bro my brain 🧠 is hanged after watching match . Any mathematic solution for this?

  • @Ayan-who
    @Ayan-who Рік тому

    I have seen that purple t-shirt guy with glasses in one of your other video

  • @dipanshuagrawal6659
    @dipanshuagrawal6659 Рік тому +2

    10:55 he has a kalawa on his wrist! Indian origin

  • @Lol-qy1dy
    @Lol-qy1dy 2 роки тому

    Multiple of 2 question soo easy...

  • @venkateshkumar9289
    @venkateshkumar9289 2 роки тому +1

    This would work right ?
    base_number = 2
    power_of = int(input("Enter the power of number: "))
    user_calculated_output = int(input("Enter the number to check if the required result is True/ False: "))
    multiply_power = base_number ** power_of
    if multiply_power == user_calculated_output:
    print("True")

    else:
    print("False")

  • @anshul2000punk
    @anshul2000punk 2 роки тому +1

    Man I just saw this video to make me realize how dumb I am.

  • @sanjaygatne1424
    @sanjaygatne1424 Рік тому

    why not popcount(x)==1 to find pow of two.

  • @pradyumnasharmakattel129
    @pradyumnasharmakattel129 2 роки тому

    harnoor? please tell me,, are you on your OPT right now or what? in what status are you there right now? you had got F1 again in dropbox from delhi,, so you are doing masters?

  • @parthankolikar5864
    @parthankolikar5864 2 роки тому

    bruh these questions are so easy

  • @lokendrasingh841
    @lokendrasingh841 2 роки тому

    brother i want to know more about cs engineering so please can you give idea of a good plate-form for coding.

  • @abhishekshankar1136
    @abhishekshankar1136 2 роки тому

    the power of 2 soln is brian kernighan algorithm , just fyi

  • @ShivamMishra-zm3hh
    @ShivamMishra-zm3hh 2 роки тому

    Wedding begins 😃😃 next year

  • @Immax_9
    @Immax_9 2 роки тому +6

    IIT--jalba h hamara 🤣

  • @MusicandChillss
    @MusicandChillss Рік тому

    IIT Bombay CS students be like bruh that is most basic question u gonna get...

  • @jasminevora852
    @jasminevora852 2 роки тому +1

    Jalwa hai .

  • @edward_cullen.07
    @edward_cullen.07 2 роки тому +2

    Whole Budget Of This Video:- $300 =₹24,501.14 😄

    • @mugiwara_
      @mugiwara_ Рік тому +2

      and revenue just 5 times of the investment

  • @ahmadcheema8389
    @ahmadcheema8389 2 роки тому

    bhai jan. Full stack web developer kha be scope ha canada ma
    plz reply

  • @nileshsaikotyada6732
    @nileshsaikotyada6732 2 роки тому

    why do Indians in US are too tall than an average Indian

    • @arpanmandal7244
      @arpanmandal7244 Рік тому

      Maybe it's all about food

    • @ranjan3528
      @ranjan3528 Рік тому

      Indians in US are not tall by any means.Average Indian is short.My cousins in US are shorter than me and my brother.It's more about food and sport.

  • @avinashgupta4038
    @avinashgupta4038 2 роки тому +1

    Lagta hai bhai ko bhi startup karne ka hai.

  • @diganta7
    @diganta7 Рік тому

    Can I know which programming language are they using?

  • @ankitrawat-acodebreaker
    @ankitrawat-acodebreaker 2 роки тому

    shouldnt N & (N-1) be O(log2N) and not O(1)

  • @yusuf_cars
    @yusuf_cars 2 роки тому

    where can I get those IIT exams pdf am studying computer science.

  • @devanshsolani2711
    @devanshsolani2711 2 роки тому

    No longer Meta Engineers😣😣

  • @randym1788
    @randym1788 2 роки тому +1

    What is not clear in the question is if the result is to be in binary format or decimal.
    1100 or 12?