O(nlogn) solution based on sorting in golang
golang\nfunc canFormArray(arr []int, pieces [][]int) bool {\n    sort.Slice(pieces, func(i, j int) bool {\n        return pieces[i][0] < pieces[j][0]\n    })\n 
```golang\nfunc canFormArray(arr []int, pieces [][]int) bool {\n    sort.Slice(pieces, func(i, j int) bool {\n        return pieces[i][0] < pieces[j][0]\n    })\n    left := 0\n    for left < len(arr) {\n        j := sort.Search(len(pieces), func(j int) bool {\n            return pieces[j][0] >= arr[left]\n        })\n        if j == len(pieces) || left + len(pieces[j]) > len(arr) {\n            return false\n        }                \n        for i := 0; i < len(pieces[j]); i++ {\n            if arr[left] != pieces[j][i] {\n                return false\n            }\n            left++\n        }\n    }\n    return true\n}\n```
[]