上一页 1 2 3 4 5 6 7 8 ··· 21 下一页

2016年8月29日

Sudoku Solver

摘要: Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may assume that there will be 阅读全文

posted @ 2016-08-29 21:24 Sheryl Wang 阅读(140) 评论(0) 推荐(0) 编辑

Merge Intervals

摘要: Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. 这题和Inser 阅读全文

posted @ 2016-08-29 16:54 Sheryl Wang 阅读(139) 评论(0) 推荐(0) 编辑

Insert Interval

摘要: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initia 阅读全文

posted @ 2016-08-29 16:16 Sheryl Wang 阅读(158) 评论(0) 推荐(0) 编辑

2016年8月28日

Combination Sum

摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat 阅读全文

posted @ 2016-08-28 10:13 Sheryl Wang 阅读(150) 评论(0) 推荐(0) 编辑

2016年8月27日

Trapping Rain Water II

摘要: Given n x m non-negative integers representing an elevation map 2d where the area of each cell is 1 x 1, compute how much water it is able to trap aft 阅读全文

posted @ 2016-08-27 16:54 Sheryl Wang 阅读(155) 评论(0) 推荐(0) 编辑

Kth Largest in N Arrays

摘要: Find K-th largest element in N arrays. Example In n=2 arrays [[9,3,2,4,7],[1,2,3,4,8]], the 3rd largest element is 7. In n=2 arrays [[9,3,2,4,8],[1,2, 阅读全文

posted @ 2016-08-27 16:33 Sheryl Wang 阅读(296) 评论(0) 推荐(0) 编辑

Spiral Matrix

摘要: 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 阅读全文

posted @ 2016-08-27 16:18 Sheryl Wang 阅读(141) 评论(0) 推荐(0) 编辑

2016年8月21日

Search a 2D Matrix

摘要: 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 f 阅读全文

posted @ 2016-08-21 22:25 Sheryl Wang 阅读(110) 评论(0) 推荐(0) 编辑

Binary Postorder Traversal

摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [3,2,1]. 后续遍历二叉树,主要是使用栈来非递归实 阅读全文

posted @ 2016-08-21 17:14 Sheryl Wang 阅读(124) 评论(0) 推荐(0) 编辑

Search in Rotated Sorted Array II

摘要: Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a functi 阅读全文

posted @ 2016-08-21 12:12 Sheryl Wang 阅读(146) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 21 下一页

导航