mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-10 00:09:06 +01:00
17 lines
210 B
Go
17 lines
210 B
Go
|
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
|
||
|
}
|