[Leetcode] PS - 001

raincoat03·2020년 6월 16일
0

PS

목록 보기
12/27
post-thumbnail

문제 링크

풀이

class Solution:
    def buildArray(self, target: List[int], n: int) -> List[str]:
        ans = []
        for i in range(1,target[-1]+1):
            if i in target:
                ans.append("Push")
            else:
                ans.append("Push")
                ans.append("Pop")
        return ans
profile
https://github.com/raincoat03

0개의 댓글