개발 기초/알고리즘

[프로그래머스/알고kit/스택,큐]같은 숫자는 싫어

아모르AMORE 2024. 1. 18. 08:08
def solution(arr):
    num = [arr[0]]
    for el in arr:
        if el != num[-1]:
            num.append(el)
    return num