Skip to content

Commit c88c56b

Browse files
authored
Create make-two-arrays-equal-by-reversing-sub-arrays.py
1 parent 96430ef commit c88c56b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Time: O(n)
2+
# Space: O(n)
3+
4+
import collections
5+
6+
7+
class Solution(object):
8+
def canBeEqual(self, target, arr):
9+
"""
10+
:type target: List[int]
11+
:type arr: List[int]
12+
:rtype: bool
13+
"""
14+
return collections.Counter(target) == collections.Counter(arr)

0 commit comments

Comments
 (0)