C++ Smart | O(N) | Explained
There are lot of helpful constraints in the problem like :\n Length of array would be equal to sum of all the lengths of pieces.\n Distinct elements in array\n 
There are lot of helpful constraints in the problem like :\n* Length of array would be equal to sum of all the lengths of pieces.\n* Distinct elements in array\n* Distinct elements in pieces\n* Re-ordering not allowed\n\nBased on this, you can think smartly and consider ``pieces``  as a treatment and ``arr`` as the control i.e. Pieces as hypothesis and Arr as reference.\n\n* Now you can have a Hash Map that only tracks the first element of each of the pieces against which you have the entire piece. For a key value pair, <K, V> , K is ``piece[0]`` and value is ``piece`` where ``piece`` is some ``pieces[i]`` for ```i >= 0 and i < N ```\n* We would now traverse the ``arr`` doing the following checks:\n\t* If the present value is not present in our hash-map, then we wont be able to solve the problem because reordering is not allowed.\n\t* If the present value is present, then we map the subarray against what is stored in the hashmap against the present value.\n\t* Finally, if we are able to match all such instances, there is an ordering possible.\n\n```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        int N = arr.size();\n        unordered_map<int,vector<int>> Mp;\n        for(auto &piece: pieces)\n            Mp[piece[0]] = piece;\n        int idx = 0;\n        while(idx < N) {\n            int val = arr[idx];\n            if(!Mp.count(val))\n                return false;\n            for(auto &piece_val : Mp[val])\n            {\n                if(idx == N)\n                    return false;\n                if(piece_val != arr[idx++])\n                    return false;\n            }\n        }\n        return idx == N;\n    }\n};\n```
['C']