Skip to content

Commit

Permalink
Update 3-1_TurnArray.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jisunp04023 authored Oct 23, 2023
1 parent 3ff4ea6 commit 04014f2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 3-1_TurnArray.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,25 @@ def func_c(first, second):
if first[i : i + length] == second:
return True
return False


def solution(arrA, arrB):
if len(arrA) != len(arrB):
return False
if func_b(arrA, arrB):
arrA_temp = func_a(arrA)
if func_c(arrA_temp, arrB):
return True
return False

arrA1 = [1, 2, 3, 4]
arrB1 = [3, 4, 1, 2]
ret1 = solution(arrA1, arrB1)

print("solution 함수의 반환 값은", ret1, "입니다.")

arrA2 = [1, 2, 3, 4]
arrB2 = [1, 4, 2, 3]
ret2 = solution(arrA2, arrB2)

print("solution 함수의 반환 값은", ret2, "입니다.")

0 comments on commit 04014f2

Please sign in to comment.