8000 [23-01-31] kyuhyun.py by lalabulla · Pull Request #32 · da-in/algorithm-study · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[23-01-31] kyuhyun.py #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def solution(arr):
answer = []

answer.append(arr[0])

for i in range(len(arr)):
if answer[-1] != arr[i]:
answer.append(arr[i])

return answer
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def solution(s):
x = len(s)
stack = []

for i in range(x):
key = s[i]

if key == ")":
if len(stack) == 0:
return False
else:
stack.pop()
else:
stack.append(key)

if len(stack) == 0:
return True
return False

11 changes: 11 additions & 0 deletions Programmers - 고득점 Kit/[해시] 폰켓몬/kyuhyun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def solution(nums):
answer = {}

pokemon_num = len(nums) // 2

for i in range(len(nums)) :
answer[nums[i]] = "new pokemon!"
if len(answer) == pokemon_num:
return len(answer)

return len(answer)
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ ex) Update README.md

### Programmers - 고득점 Kit

- 매일 돌아가며 다양한 카테고리의 문제 선별
- Day1 | [폰켓몬 #1](https://github.com/da-in/algorithm-study/issues/1), [올바른 괄호 #2](https://github.com/da-in/algorithm-study/issues/2)
- 매일 다른 카테고리 문제를 선별하여 풀기 / 약 20일 소요 예상


- Day4 | [폰켓몬 #1](https://github.com/da-in/algorithm-study/issues/1), [올바른 괄호 #2](https://github.com/da-in/algorithm-study/issues/2), [같은 숫자는 싫어 #30](https://github.com/da-in/algorithm-study/issues/30)


<br/>

Expand Down
0