이번에 넛지헬스케어 서류 통과를 하며 , 코테를 1시간 가량 진행하게 되었다.
따라서 , LeetCode 내 카테고리에서 문제를 하나씩 선정해서 풀고 있다.
https://leetcode.com/problems/longest-substring-without-repeating-characters/
dp = []
for i in range(1,s)
if s[i] in s[i-dp[i-1 ~ i]:
index = dp[i-1] 부터 s[i] 검색
dp[i] = i - index
continue
dp[i] = dp[i-1]+1
return max(dp[i])

PAYPALISHIRING , 3 =>
P A H N
A P L S I I G
Y I R
0 4 8 [0]
1 3 5 7 [1]
2 6 [2]
0 1 ( (i/num)%2 == 0 ) <-> 2 3 ( (i/num) % 2 == 1 )
ary = [""] * ( numRows +1 )
for i in range(s.length):
if int(i/num)%2==0:
ary[i % num] += s[i]
elses:
ary[num-i%num] +=s[i]
for element in ary:
answer += element
return answer

https://leetcode.com/problems/container-with-most-water/
n = 처음
v = 끝
max_num = 0
while n!=v
min_num = height[v] 랑 height[n] 중 비교
if 최대 < min_num * (v-n)
max_num = min_num *(v-n)
if height[n] 이 height[v] 보다 작다면
n+=1
else
v-=1
return max_num

https://leetcode.com/problems/coin-change/description/?envType=study-plan-v2&envId=top-interview-150
dp_ary = [0] * amount+1
for i in range(1,amount+1)
for coin in coins
if i-coin<0
continue
if dp_ary[i]==0 and dp_ary[i-coin]!=0
dp_ary[i] = dp_ary[i-coin]+1
continue
if dp_ary[i] > dp_ary[i-coin] +1
dp_ary[i] = dp_ary[i-coin] +1
return dp_ary[amoint]

=> 해당 문제에서 정답은 20 을 요구하나 , 9를 반환

혹시 코테 난이도나 유형이 어떤지 대강 알 수 있을까요?