Find Numbers with Even Number of Digits in leetcode discuss code example
Example: find numbers with even number of digits leetcode
class Solution {
public int findNumbers(int[] nums) {
int count=0;
for(int i=0;i<nums.length;i++){
int d=0;
int c=0;
while(nums[i]!=0){
d=nums[i]%10;
c++;
nums[i]=nums[i]/10;
}
if(c%2==0){
count++;
}
}
return count;
}
}