Skip to content

Commit 95e636d

Browse files
committed
Add C++ solution of problem #1295
1 parent 4ef024e commit 95e636d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

1295/solution.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution {
2+
public:
3+
int findNumbers(vector<int>& A) {
4+
int ans = 0;
5+
for(int a : A) {
6+
int cnt = 0;
7+
while(a) {
8+
cnt++;
9+
a /= 10;
10+
}
11+
if(cnt % 2 == 0)
12+
ans++;
13+
}
14+
return ans;
15+
}
16+
};

0 commit comments

Comments
 (0)