Given an integer, how could you check if it contains a 0, using Java?
1 = Good 2 = Good ... 9 = Good 10 = BAD! 101 = BAD! 1026 = BAD! 1111 = Good
How c
I don't know if this is easier but here is another way. Split the number into an array of ints. Then sort and check if the first element is zero. E.g
int n = 14501; // after splitting int na = {1, 4, 5, 0, 1}; // after sorting int na = {0, 1, 1, 4, 5};