summaryrefslogtreecommitdiff
path: root/progs/a688.py
blob: ddfc18e8e45acaa203a90ace22521dc57327c7e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
def get_Min_Squares(n):
    if n <= 3:
        return n;
    res = n 
    for x in range(1,n + 1):
        temp = x * x;
        if temp > n:
            break
        else:
            res = min(res,1 + get_Min_Squares(n  - temp)) 
    return res;