上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 33 下一页
摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note:You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2019-12-07 10:06 xuan_abc 阅读(114) 评论(0) 推荐(0)
摘要: There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop roll 阅读全文
posted @ 2019-12-06 11:57 xuan_abc 阅读(157) 评论(0) 推荐(0)
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2019-12-05 12:32 xuan_abc 阅读(255) 评论(0) 推荐(0)
摘要: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le 阅读全文
posted @ 2019-12-03 11:25 xuan_abc 阅读(130) 评论(0) 推荐(0)
摘要: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident 阅读全文
posted @ 2019-11-21 13:00 xuan_abc 阅读(80) 评论(0) 推荐(0)
摘要: Given a collection of intervals, merge all overlapping intervals. Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explan 阅读全文
posted @ 2019-11-21 12:48 xuan_abc 阅读(153) 评论(0) 推荐(0)
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2019-11-20 11:24 xuan_abc 阅读(116) 评论(0) 推荐(0)
摘要: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1, 2, 3 ], [ 4, 5, 6 ], 阅读全文
posted @ 2019-11-20 11:02 xuan_abc 阅读(160) 评论(0) 推荐(0)
摘要: Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is tha 阅读全文
posted @ 2019-11-20 10:41 xuan_abc 阅读(259) 评论(0) 推荐(0)
摘要: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: You have to rotate the image in-place, which 阅读全文
posted @ 2019-11-19 10:55 xuan_abc 阅读(137) 评论(0) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 33 下一页