Skip to content

Commit

Permalink
coding test
Browse files Browse the repository at this point in the history
  • Loading branch information
sunyeongchoi committed Nov 7, 2020
1 parent 65c1ba9 commit 9dbb24c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions argorithm/coin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def solution(money, expected, actual):
answer = -1

return answer


if __name__ == '__main__':
real_answer = solution(1000, ['H', 'T', 'H', 'T', 'H', 'T', 'H'], ['T', 'T', 'H', 'H', 'T', 'T', 'H'])
print(real_answer)
7 changes: 7 additions & 0 deletions argorithm/grades.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def solution(grades, weights, threshold):
answer = -1234567890
grade_weight = [{'A+':10}, {'A0':9}, {'B+':8}, {'B0':7}, {'C+':6}, {'C0':5}, {'B+':4}, {'B0':3}, {'F':0}]
return grade_weight

if __name__ == '__main__':
real_answer = solution(['A+', 'D+', 'F', 'C0'], [2, 5, 10, 3], 50)
15 changes: 15 additions & 0 deletions argorithm/str_split.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def solution(s, op):
answer = []
s_list = list(s)
for i in range(len(s_list)-1):
s_left = int(''.join(map(str, s_list[:i+1])))
print('s_left : ', s_left)
s_right = int(''.join(map(str, s_list[i+1:])))
print('s_right : ', s_right)
answer.append(s_left + s_right)
return answer


if __name__ == '__main__':
real_answer = solution('1234','+')
print(real_answer)

0 comments on commit 9dbb24c

Please sign in to comment.