✨ 2차원배열에서 특정 숫자가 있는 인덱스 찾기
😉 2차원 배열내에서 특정 숫자가 있는 인덱스 번호를 리스트에 넣어서 출력 해보자!
arr = [[1, 2, 3, 4, 5], [5, 4, 3, 2, 1], [1, 2, 5, 4, 3]]
index_arr = []
def rotate(two_arr: list, index, target):
if index == 0:
print('종료')
return
index = index -1
rotate(two_arr, index,target)
for arr in enumerate(two_arr[index]):
if arr[1] == target:
index_arr.append(arr[0])
rotate(arr,len(arr), 5)
print(index_arr)
[4, 0, 2]