Skip to content

Commit

Permalink
54.py
Browse files Browse the repository at this point in the history
  • Loading branch information
huisuu committed Aug 26, 2024
1 parent e1123a6 commit af94575
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions HSKIM/51to60/54.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def solution(s):
answer = ''
arr = [0 for _ in range(26)]

for c in s:
arr[ord(c) - ord('a')] += 1

for i in range(26):
while arr[i] > 0:
answer += chr(i + ord('a'))
arr[i] -= 1

return answer

print(solution("algorithm"))

0 comments on commit af94575

Please sign in to comment.