Remove Duplicates from Sorted Array 2 | Leetcode 80 | Top 150 Interview questions series

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

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

  • @Solarium1300
    @Solarium1300 2 дня назад

    Just love the way you explain...and logic hits the brain 🧠

  • @gurudassulebhavikar
    @gurudassulebhavikar Год назад +6

    Hey Amrita can you please finish this playlist? Not sure why you stopped making videos on this 150 interview question series. But out of all the channels on youtube I found only this channel where I was able to understand the solutions easily. Please continue making more videos. 🙏 Thank you.

    • @TechnosageLearning
      @TechnosageLearning  Год назад +8

      Hello,
      I am glad to know that the solutions presented here helped you.
      Due to some medical emergency we have reduced the pace, soon will start working on more solutions. please stay tuned.
      Thankyou for the understanding. 🙏

  • @SandraSaade
    @SandraSaade Год назад +12

    class Solution {
    public int removeDuplicates(int[] nums) {
    int c=0;
    for(int i=0;i

    • @differentytaadi8182
      @differentytaadi8182 2 месяца назад +1

      class Solution {
      public int removeDuplicates(int[] nums) {
      int count = 0;
      for (int i = 0; i < nums.length; i++) {
      if (count < 2 || nums[i] != nums[count - 2]) {
      nums[count] = nums[i];
      }
      }
      return count;
      }
      }

    • @roopeshmerwade6296
      @roopeshmerwade6296 Месяц назад

      @@differentytaadi8182 count should be increamented

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

    Great intuition and the approach was perfect comparing to the complex Leetcode editorial approaches.

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

    Wow, what a great explanation and a beautiful algorithm!

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

    I love your teaching style

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

    best explaination and clear mam, thank you so much mam

  • @ShubhamKumar-yz2yz
    @ShubhamKumar-yz2yz Год назад +1

    Amazing, very easy explanation, thank you

  • @muhammadomersaleem4919
    @muhammadomersaleem4919 9 месяцев назад +9

    Explanation is different from the code solution. If n == nums[i-2], 'i' doesn't increment in the code but in the explanation.

  • @mayukh_
    @mayukh_ 6 месяцев назад

    Essentially this not in constant space. Because in the for loop, you are creating another copy for the array.

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

    Crazy. Good job there.

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

    In interviews they are going to ask in place modification of the array.

  • @naviyas2305
    @naviyas2305 3 месяца назад

    thank you explained well

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

    Mam, it would be great if you give your linkedin profile in the description, and also tell your full name, it would help to make connection

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

    Well Explained dear

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

    good sol and well explained

  • @jason-rv5sp
    @jason-rv5sp 8 месяцев назад

    Great explanation. the key point is nums[i] != num[i-2]. But why in the code it becomes n != nums[i-2] ?

    • @Chitty-fr6yj
      @Chitty-fr6yj 3 месяца назад +1

      because here don't follow index number directly it takes value from the array , that is the main difference between
      for(int i=0;i

  • @vivekmalviya3036
    @vivekmalviya3036 8 месяцев назад

    Thank u ❤❤❤

  • @ayushkumarsingh875
    @ayushkumarsingh875 3 месяца назад

    Continue this series please

  • @KRRSPORTS
    @KRRSPORTS 8 месяцев назад

    if array is like that 1 2 3 4 4 4 5 5 6 in that what about 2 element

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

    great

  • @hemanthkumar3670
    @hemanthkumar3670 5 месяцев назад

    Cool

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

    how to connect with you mam..?

  • @AyushTiwari-vv2xk
    @AyushTiwari-vv2xk Год назад +2

    mam why this solution not working
    class Solution {
    public int removeDuplicates(int[] nums) {
    int j=0;
    for(int i=0;i

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

      class Solution {
      public:
      int removeDuplicates(vector& nums) {
      int j=2;
      int k=nums.size();
      if (k

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

      @@Sowmyakotha-lj8te see the code I will do it same

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

      bro because we not exactly comparing i with previous i-2 element

    • @surajsidar2294
      @surajsidar2294 10 месяцев назад

      @@mohammedmusaib4489 for this test case [1,1,1,2,2,3]
      if you compare with i-2 it won't work. You have to compare with j-2

  • @DeepakSingh-li1oe
    @DeepakSingh-li1oe 8 месяцев назад

    respect++