Problem 2825. pay it forward
Solution Stats
Problem Comments

9 Comments
If you are the first player to attempt this problem, I left number 42 open for you. Cheers!
Very creative problem! Took me a while to understand the test code and then realized I had the golden opportunity. And "paid it forward" too
Whoever you are, I have always depended on the kindness of strangers.
Sorry for the discontinuity. This problem is working again (changes in Cody were interfering with our old way of assigning notsizebased scores to solutions). Let me know if you still run into any issues.
note: as a side effect of the glitch solutions submitted between May and June 2015 had been incorrectly scored so please disregard those
It is possible to solve this problem without relying on the kindness of strangers or hacking. Just think...
@Rafael: thanks for you comment, and I guess you are right and kindness is in the eye of the beholder, but for example I see your solution using y=10 relying on Jonathan's kindness (as he submitted that 10 before you did), and similarly I see your failed but kind! y=50382 solution hopefully helping some other player solve this problem in the future, effectively paying that kindness forward (thanks!). That said, perhaps Jonathan, or you, were not really trying to be kind to others with their failed solution attempts and were instead just trying out some random solutions, but hey, I like my interpretation better :)
Everyone is entitled to an opinion, Alfonso :), but I went with Benford's Law and code analysis.
and i went with Alfonsos kind lengthy comment :)
Solution Comments

1 Comment
I did not expect that this Solution would pass. . . . Solution 556171 was submitted on 12 Jan 2015 with Size = 65535 by unknown Player (first instance, so marked as incorrect).
Solution 557603 was submitted on 14 Jan 2015 with Size = 65535 by Michael C. (second instance, so marked as correct).
Solution 828081 was submitted on 15 Feb 2016 with Size = 65535 by unknown Player (third instance, so marked as incorrect). . . . So this here would be the fourth instance, no?

3 Comments
Is this Test still working? I submitted a problem of size 100, and also returned the number 100 from the function, and AFAIK there was only one other solution with this score previously submitted (and which wasn't submitted by me), namely https://www.mathworks.com/matlabcentral/cody/problems/2825payitforward/solutions/556177 . Admittedly that supposedly needs rescoring, but I didn't think that should affect anything.
I just got the heads up that my original solution to this problem had been nullified when this problem showed up on my "not solved" listing. Out of curiosity, I entered 100 as my entry, and it told me that there were two other entries with that number. If I understand the suite correctly, and it's still working as it should, your "100" solution should probably have worked, David.
Hi, James. Actually, this Solution (my "100" Solution) was initially marked as 'incorrect', but a while after my Comment was posted the Solution was remarked to 'correct'. I surmise that Alfonso NietoCastanon updated the Test Suite to account for some changes to how Cody works. Although he has not made a Comment to that effect, besides the changed scoring of my Solution it is notable that A. N.C. also submitted a (correct) Solution on 30 Oct 2017, which I would interpret as a validation exercise by the Problem's creator. So it seems a glitch arose some time after the Problem's inception, and that glitch was fixed in mid/late October 2017. —DIV

1 Comment
Without clicking on the "Solve it now" button I though 42, then I saw your proposal...
so I choose 43 (Meeeeeeeec!)
my second try was this!
BINGOOOO!!

1 Comment
A few primes for people...

1 Comment
Please don't rescore this one, as I matched it. :)

2 Comments
Problem Recent Solvers34
Suggested Problems

6726 Solvers

How to find the position of an element in a vector without using the find function
2616 Solvers

148 Solvers

219 Solvers

Matlab Basics  Absolute Value
528 Solvers
More from this Author38
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!