about | help | code help+videos | done | prefs |
Yoda wants to know if the positive integer input parameter can be expressed as the square of a positive integer, or the sum of the squares of two positive integers. Return true if the number CAN be expressed as a square or the sum of two squares. Return false otherwise. This method can be solved nicely using backtrack recursion, but recursion is NOT required! Choose the method of solution that you prefer. Full credit will be given for non-recursive solutions. However, bonus points are available for exceptionally well-done solutions that use backtrack recursion. yodaSquaresAdvanced2(149) → true yodaSquaresAdvanced2(2) → true yodaSquaresAdvanced2(3) → false ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 430
Copyright Nick Parlante 2017 - privacy