Re: [闲聊] 每日leetcode

楼主: dont   2024-08-03 11:15:21
1460. Make Two Arrays Equal by Reversing Subarrays
## 思路
用Counter检查两字串出现char相不相同
一行easy
## Code
```python
class Solution:
def canBeEqual(self, target: List[int], arr: List[int]) -> bool:
return Counter(target) == Counter(arr)
```
作者: sustainer123 (caster)   2024-08-03 11:20:00
大师

Links booklink

Contact Us: admin [ a t ] ucptt.com