If sum is perfect square
if ( isPerfectSquare ( sum ) ) : NEW_LINE INDENT found = True NEW_LINE ans [ 0 ] = j - k + 1 NEW_LINE ans [ 1 ] = j NEW_LINE DEDENT for k in range ( ans [ 0 ] , ans [ 1 ] + 1 ) : NEW_LINE print ( arr [ k ] , end = " ▁ " ) NEW_LINE