[Java] Simple solution with O(n + m) time and O(m) space
\nclass Solution {\n    public boolean canFormArray(int[] arr, int[][] pieces) {\n        Map<Integer, int[]> map = new HashMap<>();\n        for (int[] piece :
```\nclass Solution {\n    public boolean canFormArray(int[] arr, int[][] pieces) {\n        Map<Integer, int[]> map = new HashMap<>();\n        for (int[] piece : pieces) {\n            map.put(piece[0], piece);\n        }\n        \n        int idx = 0;\n        while (idx < arr.length) {\n            int[] piece = map.get(arr[idx]);\n            if (piece == null) return false;\n            \n            for (int j = 0; j < piece.length; j++, idx++) {\n                if (piece[j] != arr[idx]) {\n                    return false;\n                }\n            }\n        }\n        \n        return true;\n    }\n}\n```
[]