Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 362 Bytes

1460.md

File metadata and controls

14 lines (12 loc) · 362 Bytes

1460. Make Two Arrays Equal by Reversing Sub-arrays

Solution 1 (time O(n), space O(n))

class Solution(object):
    def canBeEqual(self, target, arr):
        """
        :type target: List[int]
        :type arr: List[int]
        :rtype: bool
        """
        return collections.Counter(target) == collections.Counter(arr)