Problem 44348. Seemingly impossible problem
This is a seemingly 'impossible' problem, because variously your function, "impossibleFn", must return an output of either 1 or 2 or 3 for the same input (0, the number zero). Why is this described as "seemingly impossible"? Because it does not satisfy the mathematical definition of a function. Yet there is still at least one way to pass all the tests! (One simple code has been verified to work. However, all's fair in this problem, so try whichever hacks and workarounds are at your disposal.) UPDATE: Now more than three (unrelated) approaches have been verified to pass all the tests.
Solution Stats
Problem Comments
-
2 Comments
Add more tests, for example:
Test1 : 0->1
Test2: 1->1
Test3: 0->2
Test4: 6->6
Test 6: 0->0
...
Hello, Jean-Marie Sainthillier. Thanks for the suggestion. If I understand you correctly, that could be done, but it would break all/most of the previous submissions, so it seems better to do that in a separate problem — if you would like to make one. —DIV
Solution Comments
Show commentsProblem Recent Solvers26
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3058 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1296 Solvers
-
429 Solvers
-
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
249 Solvers
-
788 Solvers
More from this Author32
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!