Skip to content

Commit 9cc56cf

Browse files
authored
Merge pull request #75 from InflixOP/patch1
Create #1295. Find Numbers with Even Number of Digits.cpp
2 parents d5b7d2b + 9c8a2aa commit 9cc56cf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution {
2+
public:
3+
int findNumbers(vector<int>& nums) {
4+
int ans=0;
5+
for(int i=0;i<nums.size();i++){
6+
int c=0;
7+
while(nums[i]){
8+
c++;
9+
nums[i]/=10;
10+
}
11+
if(c%2==0)
12+
ans++;
13+
}
14+
return ans;
15+
}
16+
};

0 commit comments

Comments
 (0)