C# The array has distinct numbers - this is important
Oct. 31, 2020\n\nShare my solution written in the contest. \n\npublic class Solution {\n    public bool CanFormArray(int[] arr, int[][] pieces) {\n        var l
Oct. 31, 2020\n\nShare my solution written in the contest. \n```\npublic class Solution {\n    public bool CanFormArray(int[] arr, int[][] pieces) {\n        var length = arr.Length;\n        var rows = pieces.Length; \n        \n        \n        var map = new Dictionary<int, int>();\n        for(int i = 0; i < rows; i++)\n        {\n            map.Add(pieces[i][0], i);\n        }\n        \n        int index = 0;\n        while(index < length)\n        {\n            var current = arr[index];\n            if(!map.ContainsKey(current))\n                return false; \n            var value = map[current];\n            foreach(var item in pieces[value])\n            {\n                if(arr[index] != item)\n                    return false;\n                index++;\n            }\n        }\n        \n        return index == length; \n    }\n}\n```
[]