c++ bucket sort
Since values are limited, we can use bucket sort to index the ranges by the first element each.\nElement index zero (first element of indexes array) indicates "
Since values are limited, we can use bucket sort to index the ranges by the first element each.\nElement index zero (first element of indexes array) indicates "not found".\n\n```\n bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        array<size_t, 101> indexes = {};\n        \n        for (auto pit = cbegin(pieces); pit != cend(pieces); ++pit) {\n            indexes[pit->front()] = distance(cbegin(pieces), pit) + 1;\n        }\n        for (auto it = cbegin(arr); it != cend(arr); ++it) {\n            const auto idx = indexes[*it];\n            if (idx) {\n                const auto& piece = pieces[idx - 1];\n                //compare remaining member of this piece to arr content\n                for (auto j = 1; j < piece.size(); ++j) {\n                    ++it;\n                    if (piece[j] != *it)\n                        return false;\n                }\n            } else\n                return false;\n        }\n        return true;\n    }
['C']