Just like Matthew's problem 2793 and Edward's problem 2872 (guess the number that Cody is thinking) but now you must solve it in your first try.
Good luck!
note
despite appearances this problem does not require any hacking at all (nor even manipulation of random streams). Look at the testsuite for details and only submit your solution if you are confident that it will pass (you do have only one chance)
hint
The solution to this problem has been posted over 10,000 times in Cody
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers28
Suggested Problems
-
180 Solvers
-
144 Solvers
-
429 Solvers
-
Number of 1s in a binary string
10961 Solvers
-
Remove white space from the string
206 Solvers
More from this Author33
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Hello Alfonso. It's a pleasure to see you again. An idea why my Solution 548586 doesn't pass the test in Problem 2793 ?
Hi Jean-Marie, thanks, it is a pleasure to be back! In my opinion that does not work simply because the Matlab session where your solution is being evaluated is not a "clean" (just started) matlab session. Rather the testsuite will be evaluated by one of several Matlab servers available at any given timepoint, and while the variable space is cleared, and the directory structure is deleted before each evaluation there are many other properties (like the state of random streams, functions in memory, etc.) which are not reinitialized and will be influenced by the particular server's history of evaluated solutions (e.g. this is what allows hacks like freepass to work)
edit: Sylvain solution here shows that I was wrong above, and the random seeds *are* reinitialized before running the testsuite, only that not to their 'default' state but rather likely by using rng('shuffle') (I have to look through Cody code to see if I can confirm this but that would be consistent with the observed behavior)
Definitely happy to pass this with some good MATLAB basis and almost 0 hacking skills. Nice nice nice problem!