일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- time complexity
- 코딩테스트
- 프로그래머스
- python
- 코딩
- lambda
- 데이터분석
- 시간복잡도
- import re
- 완전탐색
- Stack
- coding test
- 조합
- join
- 파이썬
- 연습문제
- sql
- BFS
- level4
- 코테
- counter
- itertools
- cte
- collections
- Level2
- lv4
- mysql
- Queue
- coding
- programmers
- Today
- Total
목록무인도 여행 (1)
ror_coding
[Programmers] 무인도 여행 - 154540
BFS 문제..!!! BFS 지금 3번째 틀리는 건데.. 조만간 복습으로 다시 풀어야겠다. Question 지도를 나타내는 문자열 배열 maps가 매개변수로 주어질 때, 각 섬에서 최대 며칠씩 머무를 수 있는지 배열에 오름차순으로 담아 return 하는 solution 함수를 완성해주세요. 만약 지낼 수 있는 무인도가 없다면 -1을 배열에 담아 return 해주세요. Code from collections import dequedef solution(maps): answer = [] directions = [(-1,0),(1,0),(0,-1),(0,1)] rows, cols = len(maps), len(maps[0]) grid = [list(row) for row in maps]..
Algorithm/Python
2024. 12. 30. 20:47