MCPcopy Create free account
hub / github.com/ccagml/leetcode-extension / parseNode

Function parseNode

resources/debug/entry/python3/problems/589.py:17–39  ·  view source on GitHub ↗
(param)

Source from the content-addressed store, hash-verified

15
16
17def parseNode(param):
18 if len(param) is 0:
19 return
20
21 first = Node(param[0], [])
22 arr = [first]
23
24 for i, val in enumerate(param):
25 if i is 0:
26 continue
27
28 if i is 1:
29 continue
30
31 top = arr[0]
32 if val is None:
33 arr.pop(0)
34 else:
35 child = Node(val, [])
36 top.children.append(child)
37 arr.append(child)
38
39 return first
40
41
42def parseSpecialParameter(index, paramType, param):

Callers 1

parseSpecialParameterFunction · 0.70

Calls 2

appendMethod · 0.80
NodeClass · 0.70

Tested by

no test coverage detected