1
0
Fork 0
mirror of https://gitlab.com/mfocko/LeetCode.git synced 2024-11-09 15:59:06 +01:00

go: add «1460. Make Two Arrays Equal by Reversing Subarrays»

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2024-08-03 17:47:12 +02:00
parent 79db7a329c
commit ef40cbb1fd
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -0,0 +1,16 @@
package main
import "slices"
func canBeEqual(target []int, arr []int) bool {
slices.Sort(target)
slices.Sort(arr)
for i := range target {
if arr[i] != target[i] {
return false
}
}
return true
}