https://school.programmers.co.kr/learn/courses/30/lessons/42862# 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 아이디어 본문에 아래 부분을 고려해야 한다!!!! 여벌 체육복을 가져온 학생이 체육복을 도난당했을 수 있습니다. 이때 이 학생은 체육복을 하나만 도난당했다고 가정하며, 남은 체육복이 하나이기에 다른 학생에게는 체육복을 빌려줄 수 없습니다. 그래서 처음에는 전체 리스트에 1을 넣어준뒤, 여벌이 있는 사람의 값을 2로 바꿔주고, 도난당한 사람은 -1을 해주었다. 그리고 검사를 진행하면 아래 반례에도..
Coding Test
https://leetcode.com/problems/coin-change/description/?envType=study-plan-v2&envId=top-interview-150 LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com BFS 풀이 from collections import deque class Solution: def coinChange(self, ..
https://school.programmers.co.kr/learn/courses/30/lessons/87946 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 전체 코드 import copy def solution(k, dungeons): maxc = 0 def dfs(k, cnt, lefts): nonlocal maxc maxc = max(maxc, cnt) if not lefts: return for idx, l in enumerate(lefts): least, used = l if k >= least and k >= used: new_lefts =..
https://school.programmers.co.kr/learn/courses/30/lessons/42842 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 전체 코드 def solution(brown, yellow): answer = [] brown = brown // 2 r = brown c = 1 while True: if (r - 2) * (c - 1) == yellow: return [r, c+1] r -= 1 c += 1 return answer