Python O(n) by dictionary [w/ Comment]
Python O(n) by dictionary\n\n---\n\nImplementation:\n\n\nclass Solution:\n    def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool:\n        
Python O(n) by dictionary\n\n---\n\n**Implementation**:\n\n```\nclass Solution:\n    def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool:\n        \n        ## dictionary\n        # key: head number of piece\n        # value: all number of single piece\n        mapping = { piece[0]: piece for piece in pieces }\n        \n        result = []\n        \n        # try to make array from pieces\n        for number in arr:\n            \n            result += mapping.get( number, [] )\n        \n        # check they are the same or not\n        return result == arr\n```\n\n---\n\nReference:\n\n[1] [Python official docs about dictionary.get( ..., default value)](https://docs.python.org/3/library/stdtypes.html#dict.get)\n
['Iterator', 'Python', 'Python3']