Skip to content

Commit

Permalink
오랜만에 알고리즘 문제
Browse files Browse the repository at this point in the history
  • Loading branch information
sunyeongchoi committed Jan 2, 2021
1 parent 3633559 commit 2b4e37d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion argorithm/.idea/argorithm.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion argorithm/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions argorithm/pycount.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def solution(s):
pcount = 0
ycount = 0
for i in range(len(s)):
if s[i].upper() == 'P':
pcount += 1
elif s[i].upper() == 'Y':
ycount += 1
if pcount == ycount:
return True
else:
return False


if __name__ == '__main__':
real_answer = solution('Pyy')
print('정답 : ', real_answer)
13 changes: 13 additions & 0 deletions argorithm/strexam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def solution(s):
if len(s) ==4 or len(s)==6:
for i in range(len(s)):
if not s[i].isdigit():
return False
return True
else:
return False


if __name__ == '__main__':
real_answer = solution('a234')
print('정답 : ', real_answer)

0 comments on commit 2b4e37d

Please sign in to comment.