Problem 61017. The Secret Code of Mars
NASA has intercepted a mysterious signal from Mars filled with random letters and numbers. Scientists believe each number in the message represents an energy pulse needed to activate an ancient Martian device.
Your task is to decode the message by identifying all the complete numbers hidden within the string and finding their total sum. Ignore all non-digit characters, but remember that numbers may have multiple digits.
For example, the signal 'a9x12b3' should return 24, since the hidden energy pulses are 9, 12, and 3. Can you unlock Mars’s secret code?
Solution Stats
Problem Comments
-
1 Comment
Dyuman Joshi
on 20 Oct 2025 at 12:17
@Ritik, It is strongly recommended to have atleast 4 good test cases in a problem.
I recommended you to update your problem with additional test cases accordingly.
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
5 Solvers
More from this Author22
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!