Decode ways Dynamic programming Problem-Solving in Hindi | complete Recursion Playlisyt
Вставка
- Опубліковано 18 лис 2024
- In this video on Recursion and DP, part of the DATA STRUCTURE & ALGORITHM series, we will solve a Problem stated as the "Decode ways" by using Recursion and Memoization in DP.
Join My Telegram channel for more Updates: telegram.me/he...
complete DSA preparation: github.com/Pri...
Enhance your programming skills with our comprehensive courses on Competitive Programming, Data Structures, and Algorithms. Check out our Channel's Full Playlist to elevate your coding abilities!
----------------------------------------------------------------------------------------
🟠 92. Decode ways
A message containing letters from A-Z can be encoded into numbers using the following mapping:
'A' - "1" 'B' - "2" ... 'Z' - "26"
To decode an encoded message, all the digits must be grouped and then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:
"AAJF" with the grouping (1 1 10 6)
"KJF" with the grouping (11 10 6)
Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".
Given a string s containing only digits, return the number of ways to decode it.
🟣 Decode ways: leetcode.com/p...
🟢 Code in this video: github.com/Pri...
🟡 Pdf in this video: github.com/Pri...
----------------------------------------------------------------------------------------
Follow me on:
💼 LinkedIn► / iamprince
📷 Instagram► / helloworldbyprince
🐦 Twitter► / prince_king_
📲 Telegram► telegram.me/he...
📘 Facebook► / helloworldofficials
----------------------------------------------------------------------------------------
►Our Playlists on:-
🔥 Tree: • Tree Data Structure & ...
🔥 Stack & Queue: • Stack & Queue Data Str...
🔥 Hashing: • Hashing Data Structure...
🔥 Graph: • Graph Data Structure &...
🔥 Matrix: • Matrix (Multidimension...
🔥 Recursion & DP: • Recursion
🔥 Heap: • Heap Data Structure & ...
🔥 Linked List: • Linked List Data Struc...
🔥 STL: • Standard Template Libr...
🔥 Leetcode: • LeetCode Solutions And...
🔥Competitive Programming: • Full course in Competi...
🔥 C++ Full Course: • C++ full Course in HINDI
🔥 Algorithms: • L-01 || Prefix Sum Arr...
🔥 Data Structure: • Data Structures with C...
------------------------------------------------------------------------
🌟 Please leave a LIKE ❤️ and SUBSCRIBE for more AMAZING content! 🌟
✨ Tags ✨
Decode ways
Recursive playlist
Recursive solution
Recursion programming
Recursive Function
Programming tutorials
Coding challenges
Number reversal
Math problems
Algorithm design
Data structures and algorithms
Computer science education
Software development
Beginner programming
complete recursion playlist
Coding tips and tricks
C++ programming
Coding projects
Problem-solving techniques
C++ programming
Data structures and algorithms
Recursive functions
Recursive approach
Divide and conquer
Computer science
Programming tutorials
Educational videos
Beginner programming
Coding challenges
Software engineering
Algorithm Design
C++ Programming Basics
C++ Syntax
C++ Functions
Recursive Functions
Coding Tutorials
Programming languages
Computer science
Computer programming
Recursive functions
Problem-solving techniques
Software engineering
Hello World
programming
coding
tutorials
tech
software development
beginner programming
coding for beginners
programming tips and tricks
software engineering
coding tutorials
web development
programming languages
coding challenges
coding projects
software design
coding bootcamps
coding resources
C++ programming basics
C++ syntax
C++ functions
Computer science education
Beginner programming tutorials
Educational videos
solve leetcode problems
solving leetcode problems in python
solving leetcode problems c++
solving leetcode questions
solving all leetcode problems
unable to solve leetcode problems
how to solve leetcode questions
solve the equation leetcode
#recursion #geeksforgeeks #programming
Comment "#Princebhai" if you read this 😉😉
Proud to have a college alumunus like you, who produces the most easy to understand content available of youtube! Watched another video on the same topic, but didn't get the clarity of the base cases, which I got from your video, thanks, and hope to see you soon!
GREAT EXPLANATION !!!
Great Vid! #princebhai
Thank for easy explanation
Thanks a lot
nice plz continue
sure
Great video
Great explanation
Glad you think so!
bhai thinking bhi toh batani hoti hai kaise ans tak pahuche, solution koi bhi samjha dega, koi atleast batao ki why you are reaching this way only , not some other way, and how?
what if the input is 10, in your code it will return 0, but the actual output should be 1
10 will be taken as either 1 or 10 as a whole so the output should be 2. Which is satisfied by the given code. the code will return 0 only when the current character is '0' which will be the case when we consider 1 and 0 separately. I know it will be difficult to understand, just dry run the code with pen and paper, you will get the hang of it. All the best!
java solution class Solution {
public int rec(String s,int pos,int[] dp){
if(dp[pos] != -1) return dp[pos];
if(pos == s.length()) return dp[pos] = 1;
if(s.charAt(pos) == '0') return dp[pos] = 0;
int count = rec(s,pos+1,dp);
if(pos
var numDecodingsHelper = function(s,alphabets,possibleways,position,totalLength) {
if(position >= totalLength){
return possibleways
}
if(s.length == 2 && Number(s[0]+s[1]) >= alphabets.length){
return 1
}
let string = s.substring(position,totalLength)
if(string[0] !== "0" && string[1] !== "0" && alphabets[Number(string[0]+string[1])] && Number(string[0]+string[1])
bhai why 306 can't be treated as "3" and "6" ?
30 is greater than 26 and since "06" is a string, it doesn't equate to any alphabet
Bhaiya nahi samja pls help krdo
why do you give uneccesary gyaan bro? it is too much in your videos .i am disliking your video cause of this only . like we wait so that you come to the main point but you just keep giving gyaan . it is good to only upto some extent bro. give solutions to the point . take this as a constructive criticism bro . striver gives to the point answer that's why he is growing .