C++ and C#
Both solutions use same concept; For-each array in pieces, check that all elements appear in the same order within arr.\nSince the problem indicates values are 
Both solutions use same concept; For-each array in `pieces`, check that all elements appear in the same order within `arr`.\nSince the problem indicates values are distinct, we don\'t need to worry about duplicates. The problem also says that the sum of all array lengths in `pieces` is equal to the length of `arr`, so we don\'t need to worry about left over elements in `pieces`.  \n\nC++\n\n```C++\nclass Solution {\n  public:\n  bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n    for (int row = 0; row < pieces.size(); row++) {\n      auto it = std::find(begin(arr), end(arr), pieces[row][0]);\n      for (int col = 0; col < pieces[row].size(); col++) {\n        if (it == end(arr)) return false;\n        if (*(it++) != pieces[row][col]) return false;\n      }\n    }\n    return true;\n  }\n};\n```\n\nC#\n\n```C#\npublic class Solution {\n  public bool CanFormArray(int[] arr, int[][] pieces) {\n    for (int row = 0; row < pieces.Length; row++) {\n      int found = Array.IndexOf(arr, pieces[row][0]);\n      for (int col = 0; col < pieces[row].Length; col++) {\n        if (found == -1 || found >= arr.Length) return false;\n        if (arr[found++] != pieces[row][col]) return false;\n      }\n    }\n    return true;\n  }\n}\n```
['C']