Plus one | LeetCode problem 66

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

КОМЕНТАРІ • 50

  • @dhruvavishwakarma253
    @dhruvavishwakarma253 7 місяців тому +17

    Why are you not solving in Leetcode , In Leetcode this code didn't pass all test cases

    • @millenial3131
      @millenial3131 4 місяці тому

      But it is solving all cases

    • @hemant1246
      @hemant1246 2 місяці тому +2

      I applied same code and my test cases are passed brother .

  • @richiecarrasco4235
    @richiecarrasco4235 Рік тому +4

    I love the way you explain these problems. thank you

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

    didi yaar logics nahi ban rahe kya karu pls help karo itne easy questions ke logic bhi nahi soch pa raha

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

      Keep solving more and more problems...ek din logics apne aap dimag me aane lagenge jab bht sari problems solve krne se bht sari approaches pta lag jayengi

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

    Great explanation please continue this series its really helpful

  • @exactly4234
    @exactly4234 4 місяці тому

    Very good, but hard to understand for beginners. However you are the best teacher!

  • @KiranMB-yl1xl
    @KiranMB-yl1xl 11 місяців тому +6

    what if [9,9]

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

    Hey i want to know how you have mastered logic building i am a beginner and making logic of a particular problem takes a lot of time and sometimes even not getting the logic of a question at all plz give some tips.

    • @TechnosageLearning
      @TechnosageLearning  Рік тому +9

      Hi
      It takes some time..Please continue your practice.. since you are a beginner, you can watch the solution and then solve yourself again ..when you will keep on practicing...you will get to know that same logics will repeat in multiple problems....and it ll start clicking automatically when you will see the problem..

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

      @@TechnosageLearning Thanks and beside logic building, what if I learn fundamentals of a particular ds & algo topic and solve leetcode problem of that topic, is this the optimal way of learning ds & algo

    • @TechnosageLearning
      @TechnosageLearning  Рік тому +5

      Yeah..You can do that way also..Or may be solve the problems and keep learning the logics...So that you will cover all topics as well as problems...

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

    while input is 0 it is giving [1,0] it should only give [1]

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

      Hi...its returning 1 only...Please take the code from git and try it out..

    • @dhruvmahajan6345
      @dhruvmahajan6345 5 місяців тому

      @@TechnosageLearning [1,0]

    • @Aabbccddeeffgga2
      @Aabbccddeeffgga2 3 місяці тому

      @@dhruvmahajan6345 check the for loop once

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

    what about the cases of {9, 9} or {9,....,9} ?

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

      Hi..It will return the output as {1,0,0,0,0,0} which is correct output

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

    hi,
    what is the meaning of dig[i]++;
    how it work.. can we written in any different way dig[i]= dig[i+1];
    Thanks
    Rajesh

  • @SoumyadipSadhukhan-on6wn
    @SoumyadipSadhukhan-on6wn 4 дні тому

    what about if the nos are 99, 999, ...?

  • @KRajesh-ej7dy
    @KRajesh-ej7dy Рік тому

    Amrutha why u r writing

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

      less than 9 condition makes it very simple..Listen the video again and try..You will definitely understand the conditions

  • @Set_Goals963
    @Set_Goals963 9 місяців тому

    it cannot work on array {0) plz correct code

  • @SudharsanAshwin-pf3oq
    @SudharsanAshwin-pf3oq Рік тому

    What is the time and space complexity of this solution

  • @AnchalMishra-g7u
    @AnchalMishra-g7u Рік тому +2

    Kindly please tell me why you have converted this array into String type😅

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

      so that you can print an array without running a loop

  • @ashishp-c3i
    @ashishp-c3i Рік тому +1

    Amazing....you think way too straight ahead... If I show you my attempt, you will laugh 🙂...thnx...

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

    github repo link?

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

    Super logic🎉

  • @SoumyadipSadhukhan-on6wn
    @SoumyadipSadhukhan-on6wn 4 дні тому

    your explanation is not quite right ,
    class Solution {
    public int[] plusOne(int[] digits) {
    int n=digits.length;
    int[] nums={0};
    for (int i=n-1;i>=0;i--){
    if(digits[i]

  • @AhammedHussainShaik-x3h
    @AhammedHussainShaik-x3h 10 місяців тому

    can we have 3 sum leet code solution

  • @Software_engineer001
    @Software_engineer001 4 місяці тому

    newNumber[0]=1 then newNumber[1]=?

    • @millenial3131
      @millenial3131 4 місяці тому

      Will be 0 as it is not assigned

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

    Thanks for making this video

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

    Thanks

  • @SravanKumar-cy8pp
    @SravanKumar-cy8pp 2 роки тому

    Amruta I need string programs

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

      Leetcode string programs?? Or any String programming questions??

    • @SravanKumar-cy8pp
      @SravanKumar-cy8pp 2 роки тому

      Any string program s

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

      Strings Programming Questions: ua-cam.com/play/PLjOcsOwEjb135TKtYNgd08hnioIV-C1rR.html
      Here are few string programming questions..you can check it out.
      Working on more programs, Will upload soon.. Stay connected.
      Thanks!

  • @KP_PlAYS191
    @KP_PlAYS191 3 місяці тому

    No this code not pass all cases pls don't give us wrong code

    • @TechnosageLearning
      @TechnosageLearning  3 місяці тому

      @@KP_PlAYS191 All the codes on our channel have been tested on leetcode first..

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

    import java.util.*;
    class Main {
    public static void main (String [] args){
    int []nums={1,1,9};
    System.out.print(Arrays.toString(plusOne(nums))) ;
    }
    public static int[] plusOne(int[] digits) {
    int n=digits.length;
    for(int i=digits.length-1;i>=0;i--){
    if(digits[i]

  • @keshavgarg3500
    @keshavgarg3500 4 місяці тому

    wrong code

  • @VijaySaiMinuku
    @VijaySaiMinuku 2 місяці тому

    😍

  • @Rahulkumar-xb7so
    @Rahulkumar-xb7so Рік тому +1

    99 pe galt ans ayega

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

      Nhi ayega galat ans..It will return {1,0,0} which is a correct output!
      Thanks!