Problem 1444. Dots in a Circle
Solution Stats
Problem Comments
-
5 Comments
I think there is an error with the r = 7.5 test case. By the definition of the problem, it should be 177, not 172. The working solutions use a mesh that is not on integer grid points.
I also got 177 for r=7.5 as well using (the cody unfriendly) two for loops.
@Michael_C. and @James, Thank you! I have indeed overlooked that edge case. The problem is now fixed. (The "for" loops are unnecessary).
Yaroslav, you are certainly correct that for loops are not needed. I just used them to confirm that my answer using the "no-for-loop-required algorithm" was correct before commenting on the problem. My similar problem (Cody problem 1387) only used integer radii.
Thanks for the correction!
Problem Recent Solvers92
Suggested Problems
-
6625 Solvers
-
Find the maximum number of decimal places in a set of numbers
1995 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
845 Solvers
-
298 Solvers
-
Convert given decimal number to binary number.
1531 Solvers
More from this Author18
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!