摘要: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ 阅读全文
posted @ 2018-10-28 21:16 Lin.B 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number in the array. Th 阅读全文
posted @ 2018-10-18 17:56 Lin.B 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3] Follow up: Recursive s 阅读全文
posted @ 2018-10-18 15:10 Lin.B 阅读(84) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2018-10-18 14:47 Lin.B 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: All letters in hexadec 阅读全文
posted @ 2018-10-16 19:41 Lin.B 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Level Order Traversal Ⅰ Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by leve 阅读全文
posted @ 2018-10-12 21:59 Lin.B 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = 阅读全文
posted @ 2018-10-10 14:23 Lin.B 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of three. Example 1: Input: 27 Output: true Example 2: Input: 0 Output: false Example 阅读全文
posted @ 2018-10-08 20:55 Lin.B 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and o 阅读全文
posted @ 2018-10-07 22:35 Lin.B 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given t 阅读全文
posted @ 2018-10-07 19:34 Lin.B 阅读(119) 评论(0) 推荐(0) 编辑