Leetcode Helper
API
List
var List = List;
List.node
ListNode
constructor, used to create a node in list.
ListNode.prototype.toArray
Convert a List to an array. Usually used for debug.
var List = List; // { val: 1, next: { val: 2, next: { val: 3, next: null } } } var l = List; // [1, 2, 3]console;
List.create
Create a List with an array, return the head of the list which is a ListNode
instance.
var List = List; // { val: 1, next: { val: 2, next: { val: 3, next: null } } } var l = List;
List.toArray
Same as ListNode.prototype.toArray
.
Tree
var Tree = Tree;
Tree.node
TreeNode
constructor, used to create a node in tree.
Tree.create
var tree = Tree;var eq = equal;var t1 = tree;var t2 = tree; // Notice: you should implement isSameTree youself;
Create a Tree with an array, return the root of the tree which is a TreeNode
instance.
Please refer the Leetcode#faq for the rule.
LICENSE
ISC