Find sum of all values
for i in range ( n ) : NEW_LINE INDENT sum += arr [ i ] NEW_LINE DEDENT val = int ( math . sqrt ( sum ) ) NEW_LINE for i in range ( val , - 1 , - 1 ) : NEW_LINE INDENT if ( isSubsetSum ( arr , n , i * i ) ) : NEW_LINE DEDENT