Answers for "find numbers with even number of digits leetcode"

0

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;
    }
}
Posted by: Guest on April-02-2021

Code answers related to "find numbers with even number of digits leetcode"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language