class Solution { public static int sumNums(int n) { // return (int) ( (1 + n) * n * 0.5); boolean flag=n-1>0&&((n+=sumNums(n-1))>0); return n; } }