Coding Test

https://leetcode.com/problems/permutations-ii/description/ 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 전체 코드 class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: answer = [] def dfs(prefix, num):..
https://leetcode.com/problems/permutations/description/ 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 아이디어 순열을 구하는 문제였다! 두 가지 방법으로 풀었다. 1. 파이썬 제너레이터 사용 class Solution: def permute(self, nums: List[int]) -> List[List[int]]..
https://www.acmicpc.net/problem/20057 20057번: 마법사 상어와 토네이도 마법사 상어가 토네이도를 배웠고, 오늘은 토네이도를 크기가 N×N인 격자로 나누어진 모래밭에서 연습하려고 한다. 위치 (r, c)는 격자의 r행 c열을 의미하고, A[r][c]는 (r, c)에 있는 모래의 양을 www.acmicpc.net 아이디어 구현해야 할 부분은 두 가지로 아래와 같았다. 1. 전체 맵을 반시계 방향으로 이동 2. 만약 이동한 곳에 모래가 있으면, 흩날리기~ # 1. 전체 맵을 반시계 방향으로 이동하기 반시계 방향으로 이동하기 위해서 방향 벡터를 사용하였다. 이렇게 정의해준 뒤, 방향 벡터 리스트 dv를 선언해주었다. dv = [(-1, 0), (0, 1), (1, 0), (0..
https://school.programmers.co.kr/learn/courses/30/lessons/42885# 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 아이디어 people을 정렬한 후 제일 큰 수와 제일 작은 수를 합한 값이 limit 보다 작거나 같으면 둘을 태워 보내고, 아니면 제일 큰 값만 태워 보낸다. 전체 코드 from collections import deque def solution(people, limit): people.sort(reverse = True) people = deque(people) answer = 0 while..
lim.dev
'Coding Test' 카테고리의 글 목록 (2 Page)