20 Thu
๊ฐ์ ์ซ์๋ ์ซ์ด
'''
https://programmers.co.kr/learn/courses/30/lessons/12906
๊ฐ์ ์ซ์๋ ์ซ์ด
[ํ์ด]
1. ์์๋ฆฌ ์์ ๋น๊ตํด์ ์ ๊ฑฐํด๊ฐ
'''
def solution(arr):
answer = []
temp = arr[0]
for i in arr[1:]:
if temp != i:
answer.append(temp)
temp = i
answer.append(temp)
return answer
'''
๋ฐฐ์ธ์ ์ด ์๋ ์ฝ๋ ๋ค๋ฅธ์ฌ๋ ์ฝ๋
def no_continuous(s):
a = []
for i in s:
if a[-1:] == [i]: continue
a.append(i)
return a
'''
Last updated
Was this helpful?