Number of Squares
Lesson 8 of 15 in Coddy's Recursion Challenges - Master The Recursive Thinking course.
Challenge
MediumWrite a function named squareNum that gets an integer n and returns the minimum number of squares that sums to n.
Examples,
n=9-> 9 = 32 ->1n=10-> 10=32+12 ->2n=63-> 63=72+32+22+12 ->4
Try it yourself
int squareNum(int n) {
// Write code here
}All lessons in Recursion Challenges - Master The Recursive Thinking
2Medium Challenges
Knapsack ProblemNumber of SquaresInterleaving ResultSum CombinationsFind TripletSplit Array