Solution with Hash +90%
javascript []\nvar canFormArray = function(arr, pieces) {\n    let arr2 = [];\n    let d = new Map();\n    for(let t of pieces){d.set(t[0],t);}\n    for(let t o
```javascript []\nvar canFormArray = function(arr, pieces) {\n    let arr2 = [];\n    let d = new Map();\n    for(let t of pieces){d.set(t[0],t);}\n    for(let t of arr){\n        if (d.has(t)){arr2 = arr2.concat(d.get(t));}\n    }\n    return JSON.stringify(arr2)==JSON.stringify(arr);\n};\n```\n```java []\nclass Solution {\n    public boolean canFormArray(int[] arr, int[][] pieces) {\n        int[] arr2 = new int[arr.length];\n        int index = 0;\n        Map<Integer,int[]> d = new HashMap<>();\n        for(int[] t:pieces){d.put(t[0],t);}\n        for(int t:arr){\n            if (d.containsKey(t)){\n                int i=0;\n                for(;i<d.get(t).length;i++){\n                    arr2[index+i] = d.get(t)[i];}\n                index += i;\n            }\n        }\n        return Arrays.equals(arr,arr2);\n    }\n}\n```\n```ruby []\ndef can_form_array(arr, pieces)\n    arr2 = []\n    d = {}\n    pieces.each{|t| d[t[0]]=t}\n    arr.each{|t|\n        arr2 += d[t] if d.key?(t)\n    }\n    return arr2==arr\nend\n```\n
['Java', 'Ruby', 'JavaScript']