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 not-size-based 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 :)
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?
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/2825-pay-it-forward/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 Nieto-Castanon 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
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!
A few primes for people...
Please don't rescore this one, as I matched it. :-)
at last understood it. And, helped someone get a zero score
Thank you for this ;)
middleAsColumn: Return all but first and last element as a column vector
find the maximum element of the matrix
Rounding off numbers to n decimals
Sum of the Matrix Elements
Finding an element in a vector
Say something funny
One track five lanes
fly fly away
Knights and Knaves (part 1)
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office