Problem 1172. Wheat on a chessboard pt 1
Shouldn't the solution for n=-1 be NaN, rather than 'NaN' which is a character array?
I agree with Ken , we expect NaN and not the string 'NaN'
I believe you should also change the assert for the case n=-1 to be isequalwithnan, since isequal(NaN,NaN) is false.
yeap you have just rescored the problem but you need to use isequalwithnan,
actually you need to use isequalwithequalnans
tests 5 and 6 does not work properly. those numbers are out of precision, and for test 6 it couldn't be fixed even with uint64 used instead of type double
This problem is simply wrong. The right answer is
if we where to sum ALL the grains on the board....
Problem Recent Solvers162
Convert a vector into a number
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
Number of Even Elements in Fibonacci Sequence
More from this Author4
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!