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 cebddda

Browse files
[솔루션 추가]
문자열-내-p와-y의-개수
1 parent ab3491c commit cebddda

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎level-1/문자열-내-p와-y의-개수.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@ function solution(s) {
88
if (countP !== countY) answer = false
99

1010
return answer;
11-
}
11+
}
12+
13+
//정답 2 - yongchanson
14+
function solution(s) {
15+
p = s.toLowerCase().split("p").length;
16+
y = s.toLowerCase().split("y").length;
17+
18+
return p == y ? true : false;
19+
}

0 commit comments

Comments
(0)

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