Mock Coding Interview with

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

ความคิดเห็น • 165

  • @muditgupta2171
    @muditgupta2171 2 ปีที่แล้ว +57

    "yeah yeah the memory is there, but we are getting O(n) solution", such a competetive coder moment xD

    • @Mainak908
      @Mainak908 ปีที่แล้ว +3

      lol😂😂

  • @KKKK-pl8yf
    @KKKK-pl8yf 3 ปีที่แล้ว +84

    To all viewers who can watch mock interviews without being scared..u all strong hearted people deserve my respect..hats off! ...
    every time i watch a mock interview it feels so fucking scary i directly jump to leetcode to practice more xD

  • @hazemabdelalim5432
    @hazemabdelalim5432 3 ปีที่แล้ว +19

    one way to do that is , whenever you find a number duplicated more than once , you can set the hashmap[number] = 1 , and then consider the rest as part of the answer , because whatever happens we know that if number is duplicated C times , we know for sure that C-1 operations will be needed .

  • @anishsuman1371
    @anishsuman1371 2 ปีที่แล้ว +12

    His approach was just wow loved the way how he came up with that hashing approach

  • @pranavbhat29
    @pranavbhat29 3 ปีที่แล้ว +25

    Also thank you so so much for making such mock interviews. I am imagining myself being an interviewee and getting goosebumps while trying to think of an answer.... I would highly recommend this channel and the mock interviews ( including the system design mock interviews ) for anyone looking to become more confident in interviews :)

    • @KeertiPurswani
      @KeertiPurswani  2 ปีที่แล้ว +1

      Thank you so much Pranav. Your love and support means a lot to me. Will keep creating better content❤️😇

  • @visheshsharma5383
    @visheshsharma5383 2 ปีที่แล้ว +6

    Good you discussed the edge case too. One solution is to simply binary search at each index which is always n log n and doesn't depend on the values of A[i]. To handle duplicates, we can do this thing on an unique array i.e. remove duplicates before doing the binary search. After that we traverse every index of that unique array and check that how many indexes on the right of it are covered by binary search with the upper bound as A[curr_index] + n - 1. All the rest of the elements needs to be changed.
    Also, thanks for doing it. It takes lots of efforts.

  • @sumitkevlani5740
    @sumitkevlani5740 ปีที่แล้ว +1

    For the edge case, we can simply maintain 0 or 1 like the element is present or not because if any element is present more than one time then its duplicates must need to be converted to some other number.
    However, the approach discussed will give a TLE on LeetCode as it will depend on the maximum number in the array that is given as 1e9.
    This is the code for the approach discussed:
    class Solution {
    public int minOperations(int[] nums) {
    int n = nums.length;
    int mini = nums[0];
    int maxi = nums[0];
    for(int i = 0;i < n;i++){
    mini = Math.min(mini,nums[i]); //1
    maxi = Math.max(maxi,nums[i]); //1000
    }
    HashSetset = new HashSet();
    for(int num: nums){
    set.add(num);
    }
    int ans = n;
    int curr = 0;
    int num = mini;
    int k = 0;
    for(num = mini,k = 0;k < n;k++,num++){
    if(!set.contains(num)){
    curr++;
    }
    }
    ans = Math.min(ans,curr);
    while(num

  • @chetansahu1505
    @chetansahu1505 3 ปีที่แล้ว +9

    Hashing can drastically bring the TC from O(N^2) to O(N) but with a cost which is if Arr[i]>10**6 then the code will collapse. So with the constraints available on leetcode(same question obviously) the optimized TC comes down to O(NlogN) and SC to O(N). In my opinion this question doesn't qualify to be in the hard section of leetcode.
    Here is a piece of code that qualified AC.
    def minOperations(self, nums: List[int]) -> int:
    innitial_size = len(nums)
    nums = sorted(list(set(nums)))
    unique_array_size = len(nums)
    maxi = 0
    for i in range(unique_array_size):
    pos = bisect.bisect_left(nums,nums[i]+innitial_size)
    if pos>=len(nums) or nums[pos]!=(nums[i]+innitial_size-1):
    pos = pos-1
    else:
    pos = pos
    elements_within_range = (pos-i)+1
    maxi = max(maxi,elements_within_range)
    elements_off_range = innitial_size-maxi
    return elements_off_range

  • @rohandvivedi
    @rohandvivedi 3 ปีที่แล้ว +10

    Another way to handle duplicates in this problem is
    To remove all the duplicate elements from the nums array, (keeping their singular instances in the array)
    Let the number of elements removed be "k"
    Find the answer "R", for the same question considering the shorter nums array consisting of unique elements.
    return R + k

  • @subhodeepbhowmick5788
    @subhodeepbhowmick5788 3 ปีที่แล้ว +10

    These sessions and learnings are so helpful.
    Thank you so much to both.

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว

      Thank you so much, means a lot to us❤️😇😇

  • @codedoctor3265
    @codedoctor3265 4 หลายเดือนก่อน +1

    O(nlogn) Solution:
    def minOperations(nums):
    nums.sort()
    n = len(nums)
    max_len = 0
    start = 0
    for end in range(n):
    while start < end and nums[end] - nums[start] >= n:
    start += 1
    max_len = max(max_len, end - start + 1)
    return n - max_len

  • @vaibhavagrawal3381
    @vaibhavagrawal3381 3 ปีที่แล้ว +2

    I guess all this assigning max+1 is not required. Once can used actual hsh array instead of what Luv bhaiya used(Frequency array) , Just firstly making a frq array , then changing it to cumulative , then for all v[i] finding min of hsh[v[i]+n] - hsh[v[i]-1] just like he did. It will look pretty clean. Moreover , This solution is for when limit of all elements in array is 10^5 and with time complexity O(n) . (but the actual question has 10^9 range , Luv bhaiya assumed it at 28:37 ) For that time complexitiy : O(nlogn) , for every v[i] find lower_bound of v[i]+n-1 and that will help.
    My code if someone requires for 10^5 range:
    const int MAXN = 1e5 + 1;
    int hsh[MAXN];
    int main(){
    int n;
    cin >> n;
    vector v(n);
    for(int i=0;i> v[i];

    int ans = 1e5+5;
    for(int i=1;i

  • @_axel_5767
    @_axel_5767 ปีที่แล้ว

    Sample Edge cases to consider
    [-1, 5, 99, 100] ===> [97, 98, 99, 100] {2}
    [1, 1, 1, 2] ==> [1, 2, 3, 4] or [-1, 0, 1, 2] {2}
    My approach
    to first find max and min
    if max - min < num.len -1
    in this case answer should be number of duplicates because we can surely fit those duplicates in the range
    in case if max -min > num.len -1
    then we have to find the max number of missing unique element in the range of n to n + num.len - 1
    if these numbers are less than duplicates then duplicates is the answer
    else these numbers - duplicates
    we can store each count in a hash map
    we can find the numbers in the range by simply by storing the hash element before that number
    this algo would be most optimal in case of time complexity and give correct answer
    Sample Edge cases to consider

  • @mystic3549
    @mystic3549 11 หลายเดือนก่อน +1

    Came up with both the approaches O(n) and O(nlogn) by myself ...first thought of the same hashmapping and prefix summing but later realised that N would exceed the space limit and hence came up with sorting and binary searching for lower/uppr bounds and then finding out where it lies and calculating the missing elements in btw :) but i somehow missed considering the case when duplicates are present in the input array...❤

  • @AyushJain-ti5yu
    @AyushJain-ti5yu 2 ปีที่แล้ว

    //sort the array (nlogn)
    // find max and min (n)
    int i=min, int j=max
    int count=0;
    while(//some condition)
    {
    arr[j]=abs[length+min];
    count++;
    if(arr[j]=0){
    j--;
    max=arr[j];
    }
    }
    return count;

    Total T.C.= nlogn
    Though I need to filter out the if my array contains duplicates initially. That will require a separate check outside of this while loop . But my t.c. will remains same.

  • @AmitKumar-ll7jg
    @AmitKumar-ll7jg 3 ปีที่แล้ว +8

    Great content di... really loving the mock interview series. Watched all the videos. Plz never discontinue this mock interview series. ❤️🙏

  • @pranavbhat29
    @pranavbhat29 3 ปีที่แล้ว +49

    "I look so stupid kya"... That was hilarious :D. Having been on the interviewer seat. I too have heard stuff like these, especially when part of campus hiring events :D

    • @KeertiPurswani
      @KeertiPurswani  3 ปีที่แล้ว +9

      Hahaha, yeah. Hoping these mock interviews help with such small things😇😇

    • @yoyo8293
      @yoyo8293 3 ปีที่แล้ว

      @@KeertiPurswani liked the video only because of how you chose to handle this (rest of the video is superb too) but this set you apart as it felt like a more real experience :)

    • @Just..u..
      @Just..u.. 3 ปีที่แล้ว

      Keerti mam.. please help me learn data structure to a professional level where I would be able to attend interviews ...as thorough professional..

    • @anonymousfan9703
      @anonymousfan9703 2 ปีที่แล้ว +2

      @Keerti Purswani
      Mam Mock interview of
      CODE WITH HARRY
      Please
      LUV and NISHANT sir are Pro coders
      But u are missing another pro coder
      Code with Harry

  • @prathameshherwade.1295
    @prathameshherwade.1295 2 ปีที่แล้ว +1

    Di your content is so amazing. Every new video just introduces new way of solution.

  • @ytfriends7448
    @ytfriends7448 3 หลายเดือนก่อน

    we can use sliding window to find maximum elements that is inside (maxelement - minelement)

  • @abhinabarakshit1622
    @abhinabarakshit1622 3 ปีที่แล้ว +3

    Can you post the link to question if it is present in any platform? that would be really helpful.

  • @the0dd1out_on_yt
    @the0dd1out_on_yt 3 หลายเดือนก่อน +1

    It would be really helpful if you also provided the problem link(if exists) in the video description 🙏🙏🙏

  • @getmony1025
    @getmony1025 3 หลายเดือนก่อน

    if the array is [2,7,8,9] then we need only one operation to covert 2--> 6 so it becomes continuous, but you consider the min in array then it will be 2 then it requires 3 operations to convert 7,8,9

  • @akshhay
    @akshhay 2 ปีที่แล้ว +4

    Looking at the level of question, it feels like i should better change my career trajectory, this was so difficult

  • @pranavbhat29
    @pranavbhat29 3 ปีที่แล้ว +4

    Not sure if you have covered this already as a part of the feedback ( since I am commenting as I am watching ), but at 12:02, I felt that asking the interviewer an example again when the interviewer asks you an example is something which could have been avoided. Ideally it would be good if in the beginning of the interview, the candidate enumerates all possible edge cases he/she can think of. Thoughts?

  • @Someonebjg
    @Someonebjg 3 หลายเดือนก่อน

    This can also be one solution
    1. Sort the array
    2. Find min as a[0]
    3. Subtract min-1 to all numbers
    4. Now we have min as 1 and our max can he n.
    5. Make another array as visited.
    6. Ittrate in the array and for each value in the array mark visited[value] =1.
    7. At last count number of zeros in visited array.
    Is it correct?? 😊

  • @bodbuildingupdates5019
    @bodbuildingupdates5019 ปีที่แล้ว

    sort the array and count increasing elements from minimum element that to be every increased element should have a difference of one with previousElement.
    then (arr.size() - countOfIncreasing elements)
    do similar approch this taking maximum element and count decreasing element with difference of 1 with previous elements then again get (arr.size() - countOfmaximumelement)
    finally get minimum of both operation. it will give us answer
    complexity
    TC O(nlongn)
    SC O(1)

  • @shubhamkeshri8430
    @shubhamkeshri8430 3 หลายเดือนก่อน

    Sort the array, remove the duplicats and use the lower_bound

  • @vedantchourasia2842
    @vedantchourasia2842 3 ปีที่แล้ว +1

    For first question first take set and store all uniquely and copy them in new array now we can sort them first and then find differnce between two consecutives now what we want is maximum continuous 1s in differnce and we will count maximum length of continuous 1s now we got our starting point that is minimum element which tells us the ending point as well now using map we can see either can we use the element or need to use operation
    Hope this get right
    Pls let me know mam

  • @abhijeetsingh9796
    @abhijeetsingh9796 2 ปีที่แล้ว +1

    Can we do like...first we create a map and store frequency of every element of the array and then check for every element from the minimum like let's say the map is mp and if for every (1

  • @avtarchandra2407
    @avtarchandra2407 2 ปีที่แล้ว +4

    I am huge fan of @LUV he is legend in his studies always.

  • @bigdreams8924
    @bigdreams8924 2 ปีที่แล้ว +1

    These interviews boosted my confidence a lot

  • @priyanshusingh2454
    @priyanshusingh2454 3 ปีที่แล้ว +7

    Having helpful interviewers who provide hints boosts confidence in high stress interview settings. Ironically, it always turned out bad for me because the more helpful interviewers are, the quicker they provide hints. Even if I solved the complete question, using up that hint has always worked against me.
    P.S. - The expression of ma'am at 9:23 is enough to predict the result in an actual interview.😂

    • @rocklee3254
      @rocklee3254 ปีที่แล้ว +2

      So basically if interviewer gives hint then it is bad?

    • @priyanshusingh2454
      @priyanshusingh2454 ปีที่แล้ว

      @@rocklee3254 anecdotal evidence

  • @_KaifSayyad
    @_KaifSayyad 3 ปีที่แล้ว +2

    A simple solution to this would have been to sort the array and the just keep count of elements which are not contiguous to its left neighbour.
    for eg:
    [1 10 100 1000]:here ans is 3.
    this is because 3 elements (i.e 10 100 and 1000)are not contiguous to each other ( considering first element is always contiguous).
    similarly
    [1,2,100,1000]: here answer will be 2.
    this is again because there are only two elements(i.e 100 and 1000) which are not contiguous to their left neighbour.
    If this is wrong please correct me...thanks

    • @ayushnishad8252
      @ayushnishad8252 3 ปีที่แล้ว +1

      What about
      [1,2,10,11]
      According to you ans would be 1
      But ans should be 2

  • @bhavishyamalhotra1421
    @bhavishyamalhotra1421 2 ปีที่แล้ว +1

    that reaction of Keerti when he said you understand the Hashmap
    right

  • @TanmayTanejaTheBoss
    @TanmayTanejaTheBoss 6 หลายเดือนก่อน

    - poorly handles case of elements far away from each other O(MAX- MIN) > O(N) (which he claims his time complexity to be)
    - uses extra space (doesn't work when MAX > 10^7)
    - doesn't handle the case of negative elements
    probably the worst approach one could've thought of.
    this is a simple sort + two-pointer approach

  • @vaideshshankar9899
    @vaideshshankar9899 3 ปีที่แล้ว +3

    Could we have kept the count as 1 if an element is encountered regardless of its frequency? In that case cumulative sum would have been as expected.

  • @priyanshusingh2454
    @priyanshusingh2454 3 ปีที่แล้ว +3

    Instead of de-duplicating can we not just store 1 for the element instead of its frequency? Any duplicate element in the array comes at the cost of missing out on a consecutive element, so I think that'll be taken into account anyway.

    • @alaymehta2449
      @alaymehta2449 3 ปีที่แล้ว +2

      I was thinking of the same.

    • @prateekkatiyar9532
      @prateekkatiyar9532 3 ปีที่แล้ว

      You have to romove it. Which is one Operation

    • @priyanshusingh2454
      @priyanshusingh2454 3 ปีที่แล้ว +2

      @@prateekkatiyar9532 removing that duplicate is same as adding a number which is not present. Eg 1,1,3. Removing 1 is same as adding the missing 2.

  • @deepanshudutta4443
    @deepanshudutta4443 3 ปีที่แล้ว +1

    My approach,after taking the inputs in array,First find the min element in the array, The maximum element is that array.length,Then use unordered_map and store all the value and it's frequencies,after that Create s foor loop range between min to max element,after that use find function (o(1)),if the element is present or not,if present then no operation else count++, lastly print the count..is it a good approach?

  • @moneybansal2791
    @moneybansal2791 ปีที่แล้ว +1

    I think sortign array and then using lower_bound would have simply solved our problem in time complexity=nlogn

    • @devanshsengar1877
      @devanshsengar1877 ปีที่แล้ว

      No
      Suppose after sorting nums becomes (1, 5,6,7,8,13) . So according to you the transformation becomes 1,2,3,4,5,6 in this case ans will be 3 as three elements are changed to 2,3 and 4 .but the actual answer is 2 , as we can change 1 -> 4 and 13 -> 9 so nums becomes 4,5,6,7,8,9.

  • @vardhanvs
    @vardhanvs ปีที่แล้ว

    I’m not even a coder, but still I’m watching this 😂 idk why!

  • @editorera239
    @editorera239 3 ปีที่แล้ว +3

    Luv bro has got good coding skills

  • @toshitsingh7270
    @toshitsingh7270 3 ปีที่แล้ว +1

    I am really happy that I was able to solve this question in 1 try

  • @rakeshbalavanthapu
    @rakeshbalavanthapu 2 ปีที่แล้ว +1

    Does this problem exist on leetcode? If yes, please post the question number. THanks

  • @AMANGUPTA-df7hf
    @AMANGUPTA-df7hf 3 ปีที่แล้ว +2

    In the first question can we use this approach like if (min-arr[i])>arr.size-1 increment count?

  • @editorera239
    @editorera239 3 ปีที่แล้ว +1

    Thanks mam for being so active on utube !

  • @pratapujjwal4642
    @pratapujjwal4642 3 ปีที่แล้ว +2

    I just wanted to ask whether the array is sorted or not. If the array is sorted then it could be done in O(n).

  • @mayankrai7938
    @mayankrai7938 3 ปีที่แล้ว +1

    Always helpful ☺️✌️many problems I learnt from your channel get good confidence for big product based
    Companies.

  • @pranavbhat29
    @pranavbhat29 3 ปีที่แล้ว +7

    13:17 Since he is fixing the max or the min, his hash map represents the frequencies of the elements in the range [min, min + n - 1] ( or [max - n + 1, max] if max is fixed ), hence hash map will still be of size n, not max - min, right?

  • @illusionhex1200
    @illusionhex1200 ปีที่แล้ว

    I thought the same approach with both reverse and forward.
    Idk these questions seems to hard for me right now.

  • @avtarchandra2407
    @avtarchandra2407 2 ปีที่แล้ว +2

    Hey @keerti try to interview one mock with youtuber @william lin , we can learn a lot from him 🙃 i feel you,me and your audience will be surprised to the extreme 🌝

  • @anshulagarwal6682
    @anshulagarwal6682 3 ปีที่แล้ว +1

    At 11:24 approach will not work if 5 is repeated twice. So for the cases when there is repetition of number it will not work.

  • @tilakrajchoubey5534
    @tilakrajchoubey5534 3 ปีที่แล้ว

    public static int complete(int[] arr) {
    int count = 0;
    int n = arr.length;
    Arrays.sort(arr);
    int max = arr[0] + n - 1;
    for(int i = 1 ; i < n ; i++) {
    if(arr[i] == arr[i-1] || arr[i] > max)
    count++;
    }
    return count;
    }
    public static void main(String[] args){
    int[] arr = {3,3,4,5};
    System.out.println(complete(arr));
    }
    }

  • @atuljhayt
    @atuljhayt 4 หลายเดือนก่อน

    Could be a frequency array from highest to lowest value then sliding window of reuqired size and then minimum number of zeroes amongst all sliding window would be the answer

  • @bharatlakhera9727
    @bharatlakhera9727 3 ปีที่แล้ว +1

    Mam Your work is awesome 😊😊
    but the code area is slightly dark. plz use light theme or increase brightness.

  • @shivammishra-sj8jo
    @shivammishra-sj8jo 3 ปีที่แล้ว +1

    Quite good didi keep bringing didi .I have solved this question with different approach but today I learn new approach which is quite good 🔥

  • @misbahhasan6272
    @misbahhasan6272 3 ปีที่แล้ว +2

    If size of array is 15 and there is an element whose count is 11. Can we convert it into continues according to this question.

  • @deeppatel7657
    @deeppatel7657 2 ปีที่แล้ว

    Min can also be changed like [2,10,11,12,13] here just 2 is to be changed

  • @tech_wizard9315
    @tech_wizard9315 3 ปีที่แล้ว +1

    Please make a dedicated video on how to make linkedin profile so strong that recruiters of tech giant's approach freshers for job openings

  • @ankit1703
    @ankit1703 3 ปีที่แล้ว

    That hashset question was out of the box. One should try in the real interview.

  • @arpitsaini541
    @arpitsaini541 3 ปีที่แล้ว +1

    Do provide question link too

  • @sanjeevverma1991
    @sanjeevverma1991 3 ปีที่แล้ว

    Can you please also attach the link to the question in the description box ..it would be helpful?

  • @alokmishra2581
    @alokmishra2581 2 ปีที่แล้ว

    This can be done in nlogn after sorting and doing operation (in On) and counting em?

  • @Therippedroutine
    @Therippedroutine 2 ปีที่แล้ว

    If we make all hash tables second as zero initially and if duplicates are present it will not matters if check only condition that
    if(mp[first or i] ==0){
    count++;
    }
    else{
    //Nothing to do
    }
    Am I right?

  • @PROTECHRAHUL
    @PROTECHRAHUL 3 ปีที่แล้ว +1

    I was just watching his stl series ans i got this video , what a timing 😄

  • @balajiv6805
    @balajiv6805 3 ปีที่แล้ว +2

    Another nice interview, looking forward for more informative videos from you Keerti 😊😊😍😘

  • @pulkitjain5159
    @pulkitjain5159 ปีที่แล้ว

    okay , what i can see is the question is somewhat like longest consecutive sequence present in an array

  • @raghavgarg8024
    @raghavgarg8024 3 ปีที่แล้ว +1

    Can someone provide the leetcode question link for this question ??

  • @rohitbhelkar2712
    @rohitbhelkar2712 3 ปีที่แล้ว +1

    Can I get a leetcode link to this problem?

  • @manasamohankumar6208
    @manasamohankumar6208 ปีที่แล้ว

    By continuous, I think he assumed the numbers would be in a sequential manner.

  • @bigdreams8924
    @bigdreams8924 2 ปีที่แล้ว

    I don't want to show off... But Didi I watched your last google interviews and don't know how.. But i successfully thought of efficent solution within 20 mins

  • @ankitmalik7869
    @ankitmalik7869 ปีที่แล้ว

    I have no idea about whats going on.. but I abolutely enjoyed it 😊

  • @yashagrawal1821
    @yashagrawal1821 3 ปีที่แล้ว +1

    You look sick tc. Great video tho✌🏼😅 luv is too good.

  • @omprasadrathod3600
    @omprasadrathod3600 2 ปีที่แล้ว

    Can you also mentioned question link where it asked , so that we could solve.

  • @abhijeetsingh9796
    @abhijeetsingh9796 2 ปีที่แล้ว

    Can I have the problem link to check whether my solution got accepted or not?

  • @amanr11314
    @amanr11314 3 ปีที่แล้ว +1

    Maam can you share the problem link so that we can practice and see if our approach passes all test cases or not?

  • @chirag7694
    @chirag7694 3 ปีที่แล้ว

    My Answer to first question:
    int makeContiNuous(int arr[],int n){
    sort(arr,arr+n);
    int operations=0;
    unordered_sets;
    int maxi=arr[n-1];
    int mini=arr[0];
    int reqMax=mini+n-1;
    int toBeChanges=0;
    for(int i=0;i

  • @chetansahu1505
    @chetansahu1505 3 ปีที่แล้ว +2

    I don't know why this question is quoted as "Hard" in Leetcode. Though this mock interview session is awesome. Such sessions are goldmines for many aspirants.

    • @TheArchit1
      @TheArchit1 3 ปีที่แล้ว +2

      Yeah this question is pretty easily a decent medium , it should not be tagged as hard, the funny part is that he wasnt even able to solve this lol and he teaches cp and also has a course lol.

    • @TuringTested01
      @TuringTested01 3 ปีที่แล้ว +7

      @@TheArchit1 dont act you can solve all the questions everytime you see them lol, khud karne baithega toh aukaat dikhegi, yaha youtube comments mein sab raja hai

  • @vijaythakur-w1d
    @vijaythakur-w1d 11 หลายเดือนก่อน

    dii,
    what if i sort the array and check for two elements
    such that
    if a[i+1]-a[i]!=1
    count++;
    count will be the answer do it work

    • @vijaythakur-w1d
      @vijaythakur-w1d 11 หลายเดือนก่อน

      @LUV please check this out sir

  • @rite2riddhi
    @rite2riddhi 3 ปีที่แล้ว +4

    Luv OP

  • @deepanshugarg8083
    @deepanshugarg8083 ปีที่แล้ว

    I think this will not work for the case
    [1,20,21,22,24]

  • @madhav-k
    @madhav-k 3 ปีที่แล้ว +2

    11:10 no it will not work if number repeats 2 or more time 😂😂
    18:57 if(count>1)
    replaceNeeded += count -1
    20:29 what if random number is in array 😂😂

  • @ashishverma1382
    @ashishverma1382 ปีที่แล้ว

    Mam where is the link of this problem ? I want to solve this problem .

  • @pankajk9073
    @pankajk9073 2 ปีที่แล้ว

    we can do this in O(n) space and time by taking two pointer and hash map. can you share me question link so that I can check if it's possible

  • @ayushanand18
    @ayushanand18 ปีที่แล้ว

    wait is he a great competitive programmer? how can he be so without first defining 'n' in asymptotic time complexity for his algorithm. He says its O(n), Kreeti says n is the length of nums, then how come he reuse it as the (max-min) as n again? Literally they just blow off the very meaning of asymptotic time. Might be good at submitting solutions to codeforces, but that doesn't make you a great competitive programmer until you understand the true meaning of what you say.

  • @ananya8740
    @ananya8740 3 ปีที่แล้ว

    can you please make a dedicated video on c++ and oops question but not that are definition based. something that involves pointer and all .
    also get well soon :)

  • @vinaydesai8104
    @vinaydesai8104 ปีที่แล้ว

    question link? plz

  • @eeshandeo2927
    @eeshandeo2927 3 ปีที่แล้ว

    please paste the leetcode link of the question in the description

  • @itssrm870
    @itssrm870 6 หลายเดือนก่อน

    11:25 if I entered 7 at the place of 4 , then 5 is not the biggest number it will be 7 . Then it will not continuous.....
    I didn't watch , whole video , you just told that at 11:25 interval is this logic same for all cases...so I commented , Please don't mind if I wrong.

  • @pgigamingtelugu3505
    @pgigamingtelugu3505 11 หลายเดือนก่อน

    Fixing minimum doesn't work

  • @rishikumar7369
    @rishikumar7369 3 ปีที่แล้ว

    my relative told me about code to care challenge 2021 philips can you explain more about it in your next video

  • @anirudhrawat7584
    @anirudhrawat7584 2 ปีที่แล้ว

    In the whole interview Luv seemed overly aggressive and harsh in the way he speaks. He seems to fill the gap with over-explaining things. And "You know what is hash term? Right" was completely disrespectful towards the interviewer, it shows how he perceives himself with respect to the other person and it is clearly visible in other parts of the video as well. But in reality he is nothing more than a mediocre programmer with average problem solving skills. This question was not even that hard, took me about 2 and a half minutes to come up with a optimized working solution and I don't even consider myself good at cp.

  • @Shravankumar-wc2oi
    @Shravankumar-wc2oi 3 ปีที่แล้ว +5

    Lol he as cracked directi...He is top ....so he is doing all those so quickly....I don't know which company your r working in.....bring some students who r not working and conduct mock interviews...

  • @TheGeekyExplorer
    @TheGeekyExplorer 2 ปีที่แล้ว

    How about initialising the duplicates as -1....

  • @Mrnileshagarwal
    @Mrnileshagarwal ปีที่แล้ว

    Leetcode 2009 number problem is the question guys

  • @ayushthakur2896
    @ayushthakur2896 3 ปีที่แล้ว +1

    Can anyone give link to this leetcode problem?

  • @imonraj
    @imonraj 2 ปีที่แล้ว

    Can I get the leetcode link of this question

  • @souravrajput3185
    @souravrajput3185 ปีที่แล้ว

    I heard someone telling him from behind.

  • @jignesh_c30
    @jignesh_c30 3 ปีที่แล้ว +2

    Striver bhaiya kb aa rhe 😂

  • @rishavagarwal6531
    @rishavagarwal6531 3 ปีที่แล้ว

    Is this question in any websites like leetcode etc? How can i run my code. I have a different logic

    • @sachit2356
      @sachit2356 3 ปีที่แล้ว

      yup, its in leetcode..

  • @pratapujjwal4642
    @pratapujjwal4642 3 ปีที่แล้ว

    Please comment down the problem number on leetcode so that we could try on our own.