Kotlin 2 lines - sort
sort pieces by first integer index in arr\n2. flat pieces, check if two lists are equal\n\n\nfun canFormArray(arr: IntArray, pieces: Array<IntArray>): Boolean {
1. sort pieces by first integer index in arr\n2. flat pieces, check if two lists are equal\n\n```\nfun canFormArray(arr: IntArray, pieces: Array<IntArray>): Boolean {\n    pieces.sortBy { p -> arr.indexOfFirst { it == p[0] } }\n    return arr.toList().equals(pieces.flatMap { it.toList() })\n}\n```
[]