28. minimum number of squares whose sum equals to given number n
Answers
Answered by
0
Answer:
root of n
Step-by-step explanation:
a little doubt
Answered by
2
Answer:
A number can always be represented as a sum of squares of other numbers. Note that 1 is a square and we can always break a number as (1*1 + 1*1 + 1*1 + …). Given a number n, find the minimum number of squares that sum to X.
Examples :
Input: n = 100
Output: 1
100 can be written as 102. Note that 100 can also be written as 52 + 52 + 52 + 52, but this representation requires 4 squares.
Input: n = 6
Output: 3
Similar questions
Accountancy,
5 months ago
Math,
5 months ago
Science,
5 months ago
Chemistry,
9 months ago
Chemistry,
9 months ago