Make Two Arrays Equal by Reversing Sub-arrays LeetCode solution in Python

1
class Solution:
2
def canBeEqual(self, target: List[int], arr: List[int]) -> bool:
3
target.sort()
4
arr.sort()
5
if len(target) == len(arr):
6
if target == arr:
7
return True
8
else:
9
return False

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0