Check Array Formation Through Concatenation Solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n^3)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        int i, j, k, flag=0, element_present=0;\n        for(i=0 ; i<pieces.size() ; i++)\n        {\n            flag=0;\n            for(j=0 ; j<pieces[i].size() ; j++)\n            {\n                if(flag==0)\n                {\n                    for(k=0 ; k<arr.size() ; k++)\n                    {\n                        if(pieces[i][j]==arr[k])\n                        {\n                            flag=1;\n                            element_present=1;\n                            break;\n                        }\n                    }\n                    if(flag==0)\n                        return false;\n                }\n                else if(pieces[i][j]!=arr[k])\n                {\n                    return false;\n                }\n                k++;\n            }\n        }\n        if(element_present==0)\n            return false;\n        return true;\n    }\n};\n```\n![upvote new.jpg](https://assets.leetcode.com/users/images/672c5f88-cece-452f-bbbd-8e60d9c76238_1683688854.0817368.jpeg)\n
['C++']