摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. 阅读全文
posted @ 2014-06-29 23:51 jdflyfly 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. 阅读全文
posted @ 2014-06-29 23:47 jdflyfly 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram. 阅读全文
posted @ 2014-06-29 22:54 jdflyfly 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? 阅读全文
posted @ 2014-06-29 21:18 jdflyfly 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? 阅读全文
posted @ 2014-06-29 20:50 jdflyfly 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given a 2D board and a word, find if the word exists in the grid. 阅读全文
posted @ 2014-06-29 20:22 jdflyfly 阅读(381) 评论(0) 推荐(0) 编辑
摘要: Given a set of distinct integers, S, return all possible subsets. 阅读全文
posted @ 2014-06-29 17:18 jdflyfly 阅读(361) 评论(0) 推荐(0) 编辑
摘要: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. 阅读全文
posted @ 2014-06-29 17:06 jdflyfly 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). 阅读全文
posted @ 2014-06-29 16:59 jdflyfly 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. 阅读全文
posted @ 2014-06-29 16:23 jdflyfly 阅读(310) 评论(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 from left to right. The first integer of each row is greater than the last integer of the previous row. 阅读全文
posted @ 2014-06-29 13:43 jdflyfly 阅读(261) 评论(0) 推荐(0) 编辑