write a function solution that given an integer n returns the smallest non negative