Decode Ways Dynamic Programming | Total Ways to Decode a String | Count Encodings

preview_player
Показать описание

NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we discuss the Count Encodings problem where we are required to count and print all the encodings for a string as per the codes given in the question.
In this problem,
1. You are given a string str of digits. (will never start with a 0)
2. You are required to encode the str as per following rules
1 - a
2 - b
3 - c
..
25 - y
26 - z
3. You are required to calculate and print the count of encodings for the string str.
For 123 - there are 3 encodings. abc, aw, lc
For 993 - there is 1 encoding. iic
For 013 - This is an invalid input. A string starting with 0 will not be passed.
For 103 - there is 1 encoding. jc
For 303 - there are 0 encodings. But such a string maybe passed. In this case
print 0.

#dp #decodeways #dynamicprogramming
Рекомендации по теме
Комментарии
Автор

when I was in college in 2012, there was no good content on the internet, Even the net was not so cheap at that time :P. but now I am seeing you guys putting this much effort into knowledge sharing is amazing. Today students are lucky to have instructors like you. Kudos, keep up the good work.

rajk.
Автор

Very concise and informative video. That repetitive "chik hai" instead of "thik hai" though🤣

RaviYadav-bteg
Автор

I am following your website and channel sir for data structures and algorithms. May be I am the luckiest guy to get this worldclass teaching free and hatsoff to your effort sir huge respect for you

deepanshverma
Автор

The way you teach is just amazing sir, you make every single line of code easy, Big Thank you.
Pepcoding is going to be a big brand in these coming days.

yashwantkumar
Автор

I would like to thank you for this question plus I was interviewed at one place where I explained the same way how you did and they were impressed, all because of you keep doing the good work. :)

NewMovieTrailersTransformed
Автор

Starting 5 mins gave me enough idea how to solve it. Thanks a lot. I refer to ur videos first.

divyanshpant
Автор

thank you sir...u explained very well ❤

MuSicLiFesong
Автор

The quality of the lessons when you are alone is much much better. You are a gifted teacher.
I hope someday you replace these videos.

anthonya
Автор

you are the best guy, making free tutorial

sameerkumargupta
Автор

I have not seen any teacher who is explaining so much except kj sir of mathematics for jee preparation in kota.I am from IIT Indore

VKBMath
Автор

Sir, amazing explaination !! Aap ek complex problem ko piece by piece aise explain kar dete ho jaise kuch ho hi nahi . Big fan Sumeet sir !

curiouswatcher
Автор

I am a noob in DSA and as a noob i can say that i loved this video and way of explanation and i understood clearly

aryanshaw
Автор

Sir kamal ho gya sare questions hai apke pas jo companies m poochte h

SHASHANKRUSTAGII
Автор

Amazing teaching Sir, I wish i had found this channel earlier. Thank you very much.

shastriamisha
Автор

Wow, the problem breakdown really helped to understand the question properly.

jhanvisaraswat
Автор

You are really hardworking and you are doing amazing work. One recommendation please, It would be more helpful if you could do this in recursion.

umber
Автор

best explanation one can give in this problem, kudos to you. Thank you so much sir.

NirmalSilwal
Автор

Sir this dp series is very osm and understandable

RitikKumar-bkpj
Автор

Great explanation.Really, hats off Sumit Sir.

gagankhurana
Автор

wonderful explanation by sumeet malik sir <3

shubhammittal