Skip to content

Commit

Permalink
Merge pull request #22 from AlgoLeadMe/6-kjs254
Browse files Browse the repository at this point in the history
6-kjs254
  • Loading branch information
kjs254 authored Mar 5, 2024
2 parents 16b556f + 15612a7 commit 56aa19e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 4 deletions.
16 changes: 16 additions & 0 deletions kjs254/DFS/๋ชจ์Œ์‚ฌ์ „.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def dfs(my_word):
global dic
vowel = ['A','E','I','O','U']

if len(my_word)<=5:
dic.append(my_word)

for v in vowel:
dfs(my_word + v)

def solution(word):
global dic
dic = []
dfs('')
answer = dic.index(word)
return answer
9 changes: 5 additions & 4 deletions kjs254/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
|:----:|:---------:|:----:|:-----:|:----:|
| 1์ฐจ์‹œ | 2024.02.12 | ์Šคํƒ | [๊ธฐ๋Šฅ๊ฐœ๋ฐœ](https://school.programmers.co.kr/learn/courses/30/lessons/42586) | [#2](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/2) |
| 2์ฐจ์‹œ | 2024.02.15 | ํ | [ํ”„๋กœ์„ธ์Šค](https://school.programmers.co.kr/learn/courses/30/lessons/42587) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/6) |
| 3์ฐจ์‹œ | 2024.02.15 | ํž™ | [์•ผ๊ทผ์ง€์ˆ˜](https://school.programmers.co.kr/learn/courses/30/lessons/12927) | [#10](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/10) |
| 4์ฐจ์‹œ | 2024.02.15 | ํž™ | [๊ตฌ๋ช…๋ณดํŠธ](https://school.programmers.co.kr/learn/courses/30/lessons/42885) | [#14](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/14) |
| 5์ฐจ์‹œ | 2024.02.15 | ํž™ | [๋ชจ์Œ์‚ฌ์ „](https://school.programmers.co.kr/learn/courses/30/lessons/84512) | [#19](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/19) |
---
| 3์ฐจ์‹œ | 2024.02.18 | ํž™ | [์•ผ๊ทผ์ง€์ˆ˜](https://school.programmers.co.kr/learn/courses/30/lessons/12927) | [#10](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/10) |
| 4์ฐจ์‹œ | 2024.02.21 | ํ | [๊ตฌ๋ช…๋ณดํŠธ](https://school.programmers.co.kr/learn/courses/30/lessons/42885) | [#14](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/14) |
| 5์ฐจ์‹œ | 2024.02.24 | DFS | [๋ชจ์Œ์‚ฌ์ „](https://school.programmers.co.kr/learn/courses/30/lessons/84512) | [#19](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/19) |
| 6์ฐจ์‹œ | 2024.02.27 | ์Šคํƒ | [๊ด„ํ˜ธ ํšŒ์ „ํ•˜๊ธฐ](https://school.programmers.co.kr/learn/courses/30/lessons/76502) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/22) |
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
def func(bracket):
stk = []
for b in bracket:
if b in ["[","{","("]:
stk.append(b)
elif b in ["]","}",")"]:
if not stk:
return False
if stk[-1]=="[" and b=="]":
stk.pop()
elif stk[-1]=="{" and b=="}":
stk.pop()
elif stk[-1]=="(" and b==")":
stk.pop()
else:
return False
return not stk

def solution(s):
answer = 0
l = len(s)
for i in range(l):
x = s[i:]+s[:i]
if func(x):
answer +=1

return answer
16 changes: 16 additions & 0 deletions kjs254/ํ/๊ตฌ๋ช…๋ณดํŠธ.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from collections import deque

def solution(people, limit):
answer = 0
people = deque(sorted(people))

while len(people)>1:
if people[0]+people[-1]<=limit:
people.pop()
people.popleft()
answer+=1
else:
people.pop()
answer+=1

return answer+1 if people else answer

0 comments on commit 56aa19e

Please sign in to comment.