Hi, Nikhil.
Kindly read the instructions again.
" If the argument is an int
and if it is non-negative, return the sum of all integers from 0
to that argument
If you pass “0” it is a integer and it is a non-negative value, it should return sum value as “0”.
But as per your code it is returning “-1”.
kindly change condition as n>=0.
Kindly see the error message given by compiler!
All the best!