上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 54 下一页
摘要: Given an n-ary tree, return the level order traversal of its nodes' values. Nary-Tree input serialization is represented in their level order traversa 阅读全文
posted @ 2020-02-18 07:30 北叶青藤 阅读(172) 评论(0) 推荐(0)
摘要: Imagine you have an array like this (note that the array has duplicates, and includes 0 and k): a = [ 4, 64, 200, 42, 56, 22, 1, 64, 0, 161, 200, 0, 4 阅读全文
posted @ 2020-02-18 07:08 北叶青藤 阅读(140) 评论(0) 推荐(0)
摘要: Given a string s and an integer k, find out if the given string is a K-Palindrome or not. A string is K-Palindrome if it can be transformed into a pal 阅读全文
posted @ 2020-02-08 00:04 北叶青藤 阅读(294) 评论(0) 推荐(0)
摘要: Given a matrix, like this[[0, 0, 1, 1, 1][0, 1, 1, 1, 1][0, 0, 1, 1, 1][0, 0, 0, 0, 0]]each cell is either 1 or 0in each row, from left to right, when 阅读全文
posted @ 2020-02-07 11:18 北叶青藤 阅读(178) 评论(0) 推荐(0)
摘要: Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make 阅读全文
posted @ 2020-02-07 08:18 北叶青藤 阅读(148) 评论(0) 推荐(0)
摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic 阅读全文
posted @ 2020-02-07 08:11 北叶青藤 阅读(136) 评论(0) 推荐(0)
摘要: Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive). The binary search tree is g 阅读全文
posted @ 2020-02-07 07:50 北叶青藤 阅读(274) 评论(0) 推荐(0)
摘要: 给两个bst,把它们的值按照从小到大打印。 1 public static void print2BSTInorder(TreeNode n1, TreeNode n2, List<Integer> result) { 2 Stack<TreeNode> stack1 = new Stack<>() 阅读全文
posted @ 2020-02-07 07:02 北叶青藤 阅读(98) 评论(0) 推荐(0)
摘要: Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is < 5100 阅读全文
posted @ 2020-02-07 06:38 北叶青藤 阅读(173) 评论(0) 推荐(0)
摘要: byte swap一个 32位数 0x12345678 --> 0x78563412先是用了俩高低位mask 两两交换,不满意。然后用了一个mask,每次取一个byte,移位异或ans。一共执行四次,还是不满意。提示说用两步,能不能先交换 LSB 和 MSB,写了一下,但还是想不出怎么写。。。正解: 阅读全文
posted @ 2020-02-07 03:49 北叶青藤 阅读(769) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 54 下一页