C# Linq One-liner
\npublic class Solution\n{\n    public bool CanFormArray(int[] arr, int[][] pieces) => pieces\n        .OrderBy(p => Array.IndexOf(arr, p[0]))\n        .SelectM
```\npublic class Solution\n{\n    public bool CanFormArray(int[] arr, int[][] pieces) => pieces\n        .OrderBy(p => Array.IndexOf(arr, p[0]))\n        .SelectMany(p => p)\n        .SequenceEqual(arr);\n}\n```\n```\npublic class Solution\n{\n    public bool CanFormArray(int[] arr, int[][] pieces)\n    {\n        var dic = pieces.ToDictionary(p => p[0]);\n        return arr.SelectMany(a => dic.GetValueOrDefault(a, [])).SequenceEqual(arr);\n    }\n}\n```
['C#']