mediumBlind 75
Decode Ways
A message containing letters A-Z is encoded to numbers 1-26 Given a string of digits, return the number of ways to decode it Example: "12" => 2 ("AB" as 1,2 or "L" as 12) Example: "226" => 3 ("BZ" as 2,26 or "VF" as 22,6 or "BBF" as 2,2,6) Note: "06" is invalid (no mapping), so it returns 0
Each position asks whether the last digit stands alone, or pairs with the one before it. I add the two counts. Zeros break both.
StringDynamic Programming

Meet Coco
Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Typing with Coco is free when you sign in, up to a daily limit. Talking with her out loud comes with the $79 pack. Anyone can open the editor and run their code.
1Count Decode Waysmedium
Based onLeetCode