上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 29 下一页
摘要: 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 @ 2017-12-04 16:06 jasminemzy 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i 阅读全文
posted @ 2017-12-04 14:54 jasminemzy 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer. You may assume the integer do not conta 阅读全文
posted @ 2017-12-04 14:17 jasminemzy 阅读(187) 评论(0) 推荐(0) 编辑
摘要: There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacent 阅读全文
posted @ 2017-12-04 13:29 jasminemzy 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix: You s 阅读全文
posted @ 2017-12-04 10:31 jasminemzy 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2017-12-04 08:48 jasminemzy 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa 阅读全文
posted @ 2017-12-04 08:24 jasminemzy 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and </b> to wrap the substrings in s that exist in dict. If 阅读全文
posted @ 2017-12-04 06:47 jasminemzy 阅读(163) 评论(0) 推荐(0) 编辑
摘要: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文
posted @ 2017-12-03 14:35 jasminemzy 阅读(431) 评论(1) 推荐(0) 编辑
摘要: Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list 阅读全文
posted @ 2017-12-03 13:37 jasminemzy 阅读(149) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 29 下一页