11 N Digit numbers with digits in increasing order

Поділитися
Вставка
  • Опубліковано 9 лют 2024
  • Given an integer N, print all the N digit numbers in increasing order, such that their digits are in strictly increasing order(from left to right).
    Example 1:
    Input:
    N = 1
    Output:
    0 1 2 3 4 5 6 7 8 9
    Explanation:
    Single digit numbers are considered to be
    strictly increasing order.
    ------------------------------------------------------------------------------------------
    Here are some of the gears that I use almost everyday:
    🖊️ : My Pen (Used in videos too): amzn.to/38fKSM1
    👨🏻‍💻 : My Apple Macbook pro: amzn.to/3w8iZh6
    💻 : My gaming laptop: amzn.to/3yjcn23
    📱 : My Ipad: amzn.to/39yEMGS
    ✏️ : My Apple Pencil: amzn.to/3kMnKYf
    🎧 : My Headphones: amzn.to/3kMOzM7
    💺 : My Chair: amzn.to/385weqR
    🛋 : My Table: amzn.to/3TyU2IU
    ⏰ : My Clock: amzn.to/3slFUV3
    🙋🏻‍♀️ : My girlfriend: amzn.to/3M6zLDK ¯\_(ツ)_/¯
    PS: While having good gears help you perform efficiently, don’t get under the impression that they will make you successful without any hard work.

КОМЕНТАРІ • 39

  • @riteshranjan1262
    @riteshranjan1262 4 місяці тому +13

    Bhaiya please complete the DP playlist 🙏

  • @jatinverma7234
    @jatinverma7234 4 місяці тому +1

    I was watching the playlist and was just worried that why 1 video is hidden but as i reached upto this video it was available thanks. waiting for more.

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

    Same here i just opened to complete the heap series and saw new video uploaded , happy to see you back bhaiya , keep up the good work. love you bhai dheeer sara

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

    You are the best Instructor of DSA on UA-cam. I have watched all your playlists. Please make Trees playlist. PLEASEEEEEE.

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

    Why back tracking needed here!! Clean and simple.
    void Digits(String s, integer start, integer n, Array List list)
    {
    if (n== 0)
    list add your s (after parsing them into an integer object directly.)
    return;
    }
    for loop X from 1 to 9
    Digits (s + X, X+1, n - 1 , list)
    }

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

    Can you please tell names of questions for the DP patterns you have not covered in your playlist but discussed in the first video like Fibonacci(7 questions) LIS(10 questions) Kadane's (6 questions) DP on grid(14) others(3)

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

    Bhaiya after this playlist will you upload video on a topic tree.??

  • @shankysays
    @shankysays 4 місяці тому +1

    hey i have a request. in dp playlist you never made any video on longest increasing subsequence type problems. please make some videos on this pattern and how to approach this pattern please. humble request... :)

  • @kartikkalra9353
    @kartikkalra9353 4 місяці тому +1

    Agaya bhai dubara ❤

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

    Finally, bro, came back🤩❤.

  • @ApaarBawa-xx1to
    @ApaarBawa-xx1to 3 місяці тому

    python code:
    # Time Complexity: 9^n
    def increasingNumber(n):
    res = []
    # handle n = 1 case explicitely
    if n == 1:
    res = [i for i in range(10)]
    return res
    vec = []
    def solve(vec, res, n):
    # base condition
    if n == 0:
    # combine vec and append to res
    ans = 0
    for i in range(len(vec)):
    ans = (ans * 10) + vec[i]
    res.append(ans)
    return
    # iterate over choices
    for i in range(1, 10):
    # controlled recursion
    if len(vec) == 0 or i > vec[-1]:
    vec.append(i)
    # recursion call
    solve(vec, res, n-1)
    # backtrack
    vec.pop()
    solve(vec, res, n)
    return res
    Thanks for the explanation Aditya!

  • @abhishekparmar7135
    @abhishekparmar7135 4 місяці тому +1

    we could have taken a string instead of a vector so that we change and remove the characters at ease , below is my approach
    void solve(int idx,string &str,int k,vector &res){
    //base case
    if(str.size()==k){
    res.push_back(stoi(str));
    return ;
    }
    for(int j=idx+1;j

  • @mohit6215
    @mohit6215 4 місяці тому +1

    King is back 😎

  • @Itachi-kw5cs
    @Itachi-kw5cs 4 місяці тому

    Thank you brother

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

    Bhiaya sorry par mujhe aapka channel hindi me best explanation wala laga ,aur mere may be may ke baad se company aana start ho jayengi par oncapmus ke liye mujhe arrays aur strings ki series ki requirement thi , umeed aaapse hi kar rha hu please , request hai

  • @user-xn2jv2cj1h
    @user-xn2jv2cj1h 4 місяці тому +1

    bhaiya after this start trees thank you

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

    Abhi isiliye channel khola tha ki bhai ko comment karte hai ki series puri kre, aur bhai ne nyi video upload kardi😊

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

    baaki videos v bana do bhaiya 🥺. thank you.

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

    Holy f mujhai laga bhai tapak gaya😢....Glad you're doing good 😊👍

  • @yashkumar-re3by
    @yashkumar-re3by 2 місяці тому +2

    I am very grateful to you for your videos. But the solution in this video is a bit unoptimized. We dont need a vector to store digits of the number. here is a solution
    void solve(int &num, int remainingDigits, vector &ans){
    if(remainingDigits == 0){
    ans.push_back(num);
    return;
    }
    int largestDigit = num%10;
    //largest digit is the last digit
    num *= 10;
    for(int i=largestDigit+1; i

    • @karankansykar9273
      @karankansykar9273 Місяць тому +1

      You are right!!

    • @kanganabhargava1273
      @kanganabhargava1273 25 днів тому +1

      What's need of n=n/10. It is working fine without it also.

    • @yashkumar-re3by
      @yashkumar-re3by 24 дні тому

      @@kanganabhargava1273 I am assuming you meant the code is running without num = num/10. If you look closely, in the solve function, I am passing num as pass by reference (for space optimization). It will work without num=num/10 if you use int num as pass-by-value in the solve method.
      Hope this helps !

  • @PiyushCodes-ph3hl
    @PiyushCodes-ph3hl 4 місяці тому

    Bhaiya aap DP series complete karwa do please
    and baki topics bhi le aao
    also if possible then striver bhaiya wali sheet types patterns match kar sakte ho toh best not telling to copy but

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

    love u 3000 bhaiya ❤❤

  • @sahebraojadhav9727
    @sahebraojadhav9727 4 місяці тому +1

    Bhai please complete dp

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

    "9!" hoga na time complexity?

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

    bhaiya yar thoda graph bhi padha do esake bad please and please take cses problem set graph question

  • @prateek4279
    @prateek4279 3 місяці тому +1

    did this question by myself without seeing the vid

  • @kaushikramabhotla4635
    @kaushikramabhotla4635 4 місяці тому +1

    Bhai 🤩

  • @suraj_patwa
    @suraj_patwa 4 місяці тому +1

    Welcome Again

  • @kannan.m9274
    @kannan.m9274 4 місяці тому

    Sir pls kindly add subtitles in dp playlist sir pls sir

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

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

    Bhai poori kardo please yarr ❤❤

  • @souviksen5177
    @souviksen5177 6 днів тому

    Java Solution:
    class Solution {
    static ArrayList list;
    public static ArrayList increasingNumbers(int n) {
    list = new ArrayList();
    ArrayList temp = new ArrayList();
    if(n == 1){
    for(int i=0; i

  • @NextLevelShit
    @NextLevelShit 4 місяці тому +1

    133 view but itne kam like ?

  • @kullumanali-bu8uf
    @kullumanali-bu8uf 4 місяці тому

    the real slim shady

  • @AnkeshKumar-fx4dl
    @AnkeshKumar-fx4dl 4 місяці тому +1

    Bro❤❤❤