목록배열 회전 (2)
일상 코딩
https://www.acmicpc.net/problem/1236 1236번: 성 지키기 첫째 줄에 성의 세로 크기 N과 가로 크기 M이 주어진다. N과 M은 50보다 작거나 같은 자연수이다. 둘째 줄부터 N개의 줄에는 성의 상태가 주어진다. 성의 상태는 .은 빈칸, X는 경비원이 있는 칸이다 www.acmicpc.net N, M = map(int, input().split()) B = [list(input()) for _ in range(N)] cnt = 0 def X_check(arr): ret = 0 for i in arr: if 'X' in i: continue else: ret += 1 return ret def rotated(array_2d): return [list(elem) for elem..
https://comdoc.tistory.com/entry/Python-Zip-2%EC%B0%A8%EC%9B%90-%EB%B0%B0%EC%97%B4-%ED%9A%8C%EC%A0%84 Python Zip 2차원 배열 회전 1. zip 내장 함수(BIF) zip은 각 iterables의 요소들을 하나씩 모아 이터레이터를 만듭니다. iterable (이터러블) 멤버들을 한 번에 하나씩 돌려줄 수 있는 객체. 이터러블의 예로는 모든 (list, str, tuple 같 comdoc.tistory.com https://choichumji.tistory.com/74 [python] 2차원 리스트 90도 돌리기 def rotated(array_2d): list_of_tuples = zip(*array_2d[::-1])..