leetpycode/easy/make_two_arrays_equal_by_reversing_subarrays.py

8 lines
257 B
Python

# https://leetcode.com/problems/make-two-arrays-equal-by-reversing-subarrays
from typing import List
class Solution:
def canBeEqual(self, target: List[int], arr: List[int]) -> bool:
target.sort()
arr.sort()
return target == arr