Instead you ask her to multiply her age by 10, then subtract any of the first nine multiples of 9 (9,18,...,81), and tell you the result. Based on this number N, find the lady's age.
Example: input N=384, output a=42. Indeed, 42*10 - 36 = 384.
The function is not injective, the same output age a corresponds to multiple input values N.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers37
Suggested Problems
-
Maximum running product for a string of numbers
2254 Solvers
-
Increment a number, given its digits
684 Solvers
-
Arrange Vector in descending order
13331 Solvers
-
Fahrenheit to Celsius converter
601 Solvers
-
Switch matrix to a column vector
374 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!