일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- collections
- 파이썬
- 데이터분석
- lv4
- CodingTest
- counter
- sql
- 코딩
- programmers
- coding
- 시간복잡도
- 연습문제
- 조합
- import re
- time complexity
- Level2
- 코딩테스트
- python
- lambda
- 완전탐색
- itertools
- mysql
- 코테
- 프로그래머스
- BFS
- level4
- Queue
- join
- coding test
- Stack
- Today
- Total
목록154540 (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