Problem 1946. Fibonacci-Sum of Squares
Solution Stats
Problem Comments
-
3 Comments
Additional test cases have been added.
There is a typo in the question. F_0 = 0 should be F_0 = 1 otherwise the tests will not be passed.
It shows me wrong!
Solution Comments
-
2 Comments
My solution has much higher size. Someone pls suggest edit. thanks
Hello, Dishant Varshney. Your solution is quite legitimate, and that is more important than having a small size! Some comments: 〔1〕 Your code "i = 1: length(f)" and then "f(i)" can be simplified to just "f". You do not need to provide index ranges if you want to refer to _all_ elements of an array or vector. 〔2〕 I would guess that some of the very small submissions have 'cheated' (e.g. by hard-coding solutions in a lookup table), because this Test Suite does not check for any such 'cheats'. 〔3〕 Your solution would fail for n=1, but that is also not checked in this Test Suite. Regards, DIV
Problem Recent Solvers940
Suggested Problems
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
339 Solvers
-
Convert a vector into a number
571 Solvers
-
Find the maximum number of decimal places in a set of numbers
1916 Solvers
-
10152 Solvers
-
509 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!