반응형
Write a function reverse which reverses a list (or in clojure's case, any list-like data structure)
(the dedicated builtin(s) functionalities are deactivated)
Solution:
def reverse(lst):
result = list()
for _ in range(len(lst)): result.append(lst.pop())
return result
반응형
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
0123. Check same case (0) | 2023.01.23 |
---|---|
0122. The Feast of Many Beasts (0) | 2023.01.23 |
0120. Alphabet symmetry (0) | 2023.01.21 |
0119. Thinkful - Number Drills: Blue and red marbles (0) | 2023.01.19 |
0118. Ordered Count of Characters (0) | 2023.01.18 |