Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 95e636d

Browse files
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‎

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>& 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)

AltStyle によって変換されたページ (->オリジナル) /