Digit dynamic programming with a SPOJ example

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • Digit Dynamic Programming involves finding the sum, count or any aggregation of numbers whose digits satisfy a given set of properties. Digit DP is an advanced topic for competitive programmers, and requires some prior knowledge of dynamic programming.
    Help the community by filling out the survey from SoundRocket here:
    srsrv.com/GKCS
    The Study of Digital Platform Workers will help the international community to better understand workers motivations to perform competitive programming tasks, as well as to have a better idea of their working conditions, employment opportunities, and related experiences. The study is being funded by the International Labour Organization, which is an agency of the United Nations, which sets labour standards and develops policies promoting decent work for all women and men. More about the ILO can be found here: www.ilo.org/ The ILO has contracted with SoundRocket, and independent survey research consulting firm located in Ann Arbor, Michigan, USA to conduct the survey.
    We are looking for people who participate in competitive programming to participate in this survey-including those who participate purely in competitions, as well as those who participate in industry-sponsored challenges.
    Those who respond to the survey will be promised confidentiality. Their responses will be made anonymous once data collection is completed and prior to any analysis. Their identity will not be linked to the research data file in any way. The findings will be part of a larger research project seeking to better inform policy debates on the on-demand economy.
    Below are the links to the SPOJ problems and solutions related to digit dynamic programming:
    GONE Problem -
    www.spoj.com/p...
    pastebin.com/M...
    RAONE Problem -
    www.spoj.com/p...
    pastebin.com/P...
    LUCIFER Problem -
    www.spoj.com/p...
    pastebin.com/Q...
    Preparing for software engineering interviews?
    AlgoExpert:
    www.algoexpert....
    Made by engineers from Google and Uber, this site helps you build your algorithmic skills using code and white board explanations.
    Be sure to use the code 'gaurav' for the discount. You get 30% off!
    Preparing for design Interviews? Check out the "Grokking the system design interview" course:
    www.educative....
    System Design Playlist: • System Design Playlist
    Become a channel member!
    / @gkcs
    You can follow me on:
    Facebook: / gkcs0
    Quora: www.quora.com/...
    LinkedIn: / gaurav-sen-56b6a941
    Twitter: / gkcs_

КОМЕНТАРІ • 80

  • @gkcs
    @gkcs  5 років тому +44

    Did you find the video useful? Feel free to share the video with your friends and on Competitive Programming forums!

    • @rajatguptaseth
      @rajatguptaseth 5 років тому +1

      Please also keep making videos on competitive programming.

    • @Jessy-iz7du
      @Jessy-iz7du 5 років тому

      It was indeed helpful Gaurav..thanks .. ee need more of dynamic programming.. also can u please consider about making it digital presentation rather than whiteboard..

    • @kriess2507
      @kriess2507 5 років тому

      Great video, one suggestion though, please avoid zooming in, it's quite irritating, whatever you right is still visible, but if you think otherwise please try writing into a larger font than zooming in :)

    • @bushnam
      @bushnam 4 роки тому

      Thank you very much for doing this. It was very helpful.

  • @KomalSingh-bh8zr
    @KomalSingh-bh8zr 4 роки тому +4

    Was wondering when you would make a video on dynamic programming, thanks to your wonderful explanation I am finally able to understand it better!

  • @THEkarankaira
    @THEkarankaira 5 років тому +5

    i searched this for first time today and u have had uploaded it ...

  • @AlgoHacks
    @AlgoHacks 5 років тому +17

    Even though your 0 is similar to 9 and u as well was confused between them once in a while 😃
    It's was great explanation.

    • @gkcs
      @gkcs  5 років тому +1

      I replaced it from time to time 😛
      Thanks!

  • @sudheertripathi3882
    @sudheertripathi3882 5 років тому +11

    Wow , a digit dp qn was asked in today's Oct Easy , beautifully explained , thanks :)

    • @inosuke44
      @inosuke44 5 років тому +2

      www.spoj.com/problems/GONE/
      same problem

    • @saiswaroop5889
      @saiswaroop5889 5 років тому

      what are u talking about

    • @santosh_bhat
      @santosh_bhat 5 років тому +1

      @@saiswaroop5889 hackerearth october easy challenge

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

    Great video! That additional state dimension of being "on the edge" was the key to cracking this problem

  • @saumyamishra3997
    @saumyamishra3997 5 років тому +1

    Really nice explanation of why there is a need to pass certain parameters, I was reading the same thing on other platform as well but this video really stands out.

    • @gkcs
      @gkcs  5 років тому

      Thanks!

  • @shivankgautam9079
    @shivankgautam9079 5 років тому

    Great video, I was waiting for you or Tushar to make it. Thanks.

  • @IML84ever
    @IML84ever 5 років тому

    Seriously wanted a video on this topic.
    Your explanation is Great👍.
    Thank you very much.✌️

  • @27.Counting
    @27.Counting 5 років тому +1

    Stopped the video at 8:04 . Looks like I will give it a try and see if I understand until this point before moving forward. Great explanation of not just the problem, but also of how to approach any problem.

    • @gkcs
      @gkcs  5 років тому +1

      All the best!

  • @BackToBackSWE
    @BackToBackSWE 5 років тому +1

    the king 👑

    • @gkcs
      @gkcs  5 років тому +2

      😁

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

    beautiful!

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

      Thank you!

  • @muskanagarwal7937
    @muskanagarwal7937 5 років тому

    Nice explanation... Missed your CP related videos.. please upload more frequently...

  • @shankarbanerjee8746
    @shankarbanerjee8746 5 років тому +1

    Awesome explanation !! Sir please make more videos on DP🙏

    • @gkcs
      @gkcs  5 років тому

      Thanks!
      You can check out the dp playlist on the channel.

  • @niharikaepuri3305
    @niharikaepuri3305 5 років тому +8

    The similar ques was asked in phone pe coding test :p

    • @varsha4260
      @varsha4260 4 роки тому

      it was a 75 marks question asked in intuit hiring challenge

  • @pgmz
    @pgmz 4 роки тому

    Great explanation! Thanks

  • @wian7284
    @wian7284 5 років тому

    Hey Gaurav, thanks for letting us in in having such thought process oriented problem solving. Great job please do more of these if you can.
    P.S you seem lot more happy and light..lemme not ask why :p

    • @gkcs
      @gkcs  5 років тому

      Hahaha!

  • @yashagarwal5897
    @yashagarwal5897 5 років тому

    Really great explanation. I was struggling with this topic for such a long time. Thanks Gaurav. Also can u make a video on flows?

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

    Can anyone give me the problem link, please?

  • @jayshree9037
    @jayshree9037 4 роки тому

    Wow this popped up. I was looking since a long time

  • @prakharshekharparthasarthi8313
    @prakharshekharparthasarthi8313 5 років тому +1

    how no of digits log(n)?

    • @gkcs
      @gkcs  5 років тому +1

      Use the video card which flashes at that time?

  • @dipteshsil9299
    @dipteshsil9299 5 років тому

    Nice one. really liked the memoization technique.

  • @prakharshekharparthasarthi8313
    @prakharshekharparthasarthi8313 5 років тому +4

    just a request
    Please improve clarity of videos

  • @amirfaisal5372
    @amirfaisal5372 4 роки тому

    great explanation

  • @ashutosh.sharma
    @ashutosh.sharma 5 років тому

    Thanks for the great explanation. :)
    Video Suggestion: SOS DP

  • @AJabcdefghi
    @AJabcdefghi 5 років тому

    Given an array find the maximum difference between sum of elements present at odd and even positions.You can delete any number of elements you want to . Please any one can tell me solution??

  • @diptanshupurwar5575
    @diptanshupurwar5575 4 роки тому

    how do you get log(N) for the number of digits? can you please provide an explanation for that?

    • @gkcs
      @gkcs  4 роки тому

      ua-cam.com/video/Xe9aq1WLpjU/v-deo.html

  • @PrashantKumar-gg5qd
    @PrashantKumar-gg5qd 5 років тому

    Thanks a lot 🙏🙇

  • @lunaticar8300
    @lunaticar8300 5 років тому

    can you pls explain one program related to digit dynamic
    programming

  • @JavaAidTutorials
    @JavaAidTutorials 5 років тому

    Nice One Buddy..!!

    • @gkcs
      @gkcs  5 років тому

      😁

  • @swastiksingh8452
    @swastiksingh8452 5 років тому +1

    nice explanation.
    try to explain the logic more and touch other ways to approach the problem, rather than focusing on the code itself

  • @metalrey2064
    @metalrey2064 4 роки тому +1

    Pro tip: to get these concepts watch it at 0.25

  • @FazeelUsmani
    @FazeelUsmani 4 роки тому

    Hi Gaurav, I'm here at DevFest Hyderabad. Where are you? I want to meet you!

    • @FazeelUsmani
      @FazeelUsmani 4 роки тому

      I just wanted to wish you HaPpY BiRtHdAy

  • @rajatguptaseth
    @rajatguptaseth 5 років тому

    Nice one.

  • @ketanmehtaa
    @ketanmehtaa 4 роки тому

    gaurav bhaiya ,video is blurring ,not much clear please increase the video quality :)

    • @ketanmehtaa
      @ketanmehtaa 4 роки тому

      clearity in video quality is not good

    • @ketanmehtaa
      @ketanmehtaa 4 роки тому

      otherwise the concept you explained is excellent !

  • @pranav1605
    @pranav1605 5 років тому +2

    It seem's like someone thought you "6 ka ulta 9", you literally write 9 that way! 😃

    • @gkcs
      @gkcs  5 років тому

      😛

  • @subhajitdas2784
    @subhajitdas2784 4 роки тому

    Better Camera please

  • @shubhambansal5487
    @shubhambansal5487 5 років тому

    Hey, Thanks for this.
    But why your camera becomes out of focus every-time?

    • @gkcs
      @gkcs  5 років тому

      I messed up this time too. The focus was fixed in the past two videos but this one didn't go as planned.

    • @shubhambansal5487
      @shubhambansal5487 5 років тому +1

      @@gkcs One suggestion, try to look the video camera(while recording) after 2 to 5 minutes so that you could be sure about the out of focus problem.

  • @balajisv4052
    @balajisv4052 5 років тому

    Back to CP from system design and ML. Hope you are preparing for an job change. LOL. Anyway keep generating content for the people.

  • @savansoni8947
    @savansoni8947 4 роки тому

    Happy birthday🥳🥳🥳

  • @VIKASKUMAR-bh5sj
    @VIKASKUMAR-bh5sj 4 роки тому

    Calm down you good..!

  • @ironhide9955
    @ironhide9955 5 років тому +1

    when i saw dp in the title, i thought something else but that's just me..

    • @gkcs
      @gkcs  5 років тому

      Hahaha

  • @baneado3226
    @baneado3226 4 роки тому

    Gaurav, which is your codeforces handle? I want to add you as a friend and see you subs :3

  • @sB-sb5mv
    @sB-sb5mv 5 років тому

    log(n^2) or (log(n))^2

    • @gkcs
      @gkcs  5 років тому

      The latter.

  • @tiwarikishan12
    @tiwarikishan12 5 років тому

    big fan

  • @sourojitsen5817
    @sourojitsen5817 4 роки тому

    Most tricky is 11:20

  • @gamedev90
    @gamedev90 5 років тому

    isn't it n^2

    • @gkcs
      @gkcs  5 років тому

      What is?

    • @gamedev90
      @gamedev90 5 років тому

      @@gkcs the unoptimised approach n numbers * sum of n digits in a number

  • @hariikrishnan
    @hariikrishnan 5 років тому

    You are going to jail for how you write 9, never seen someone write 9 like that.

    • @gkcs
      @gkcs  5 років тому

      Hahaha!

  • @rohan8arora
    @rohan8arora 5 років тому

    1st 😂