남남이루의 고군분투 🌳

  • 태그
  • 방명록
  • GIT Hub

스택 1

[스택] 프로그래머스 lv1. 크레인 인형뽑기 게임

문제 인형이 쌓인 board에서 맨 위에 인형 하나씩 moves에 따라 꺼낸다. 꺼낸 인형들은 바구니에 담는데, 바구니에 담긴 인형들은 연달아 같은 인형이 담길 경우 제거된다. 제거된 인형의 개수는? 문제 바로가기 코드 def solution(board, moves): bucket = [] for j in moves: # 각 열에 있는 인형들 꺼내서 바구니에 담기 for i in range(len(board)): if board[i][j-1] != 0: bucket.append(board[i][j-1]) board[i][j-1] = 0 break cnt = 0 while True: long = len(bucket) # 더이상 인형제거가 발생하지 않는지 확인하기 위해 for i in range(1,len(..

⚡️algorithm 2022.05.30
1
더보기
프로필사진

구구절절 개발블로그

  • Category (179)
    • Project (5)
    • Programming (36)
      • 💥 뽀개기 (1)
      • ☕ JavaScript (5)
      • 🧞‍♂️ React, TypeScript (6)
      • 🐍 Python (6)
      • 📚 Book Study (6)
      • 🌐 Web (3)
      • Tips (5)
    • ⚡️algorithm (98)
      • step-up ++ (6)
      • accepted (14)
      • master (1)
    • News (5)
      • Frontend (5)
      • Backend (0)
    • log ✎⁾⁾⁾ (30)
      • comming soon (0)
      • career (7)

Tag

이분탐색, Set, clean code, 더오래하면돼, 파이썬, BFS, 그래프, 부스트캠프, 책스터디, ADHD, 클린코드, 알고리즘, combinations, 그리디, DP, Dictionary, 프로그래머스, Git, DFS, typescript,

Archives

«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

최근댓글

방문자수Total

  • Today :
  • Yesterday :
글쓰기 관리자 GitHub

Copyright © Kakao Corp. All rights reserved.

  • Github

티스토리툴바