10 2015 档案
摘要:原题链接在这里:https://leetcode.com/problems/contains-duplicate-iii/ 题目: Given an array of integers, find out whether there are two distinct indices i and j
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shortest-palindrome/ 题目: Given a string S, you are allowed to convert it to a palindrome by adding characters in
阅读全文
摘要:https://www.linkedin.com/pulse/my-top-5-questions-ask-interview-morna-simpson
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-palindromic-substring/ 题目: Given a string s, find the longest palindromic substring in s. You may assume
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/restore-ip-addresses/ 题目: Given a string containing only digits, restore it by returning all possible valid IP a
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/number-of-digit-one/每10个数, 有一个个位是1, 每100个数, 有10个十位是1, 每1000个数, 有100个百位是1. 做一个循环, 每次计算单个位上1得总个数(个位,十位, 百位).例子:以算百...
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/n-queens-ii/ 题目: Follow up for N-Queens problem. Now, instead outputting board configurations, return the total
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/letter-combinations-of-a-phone-number/ 题目: Given a digit string, return all possible letter combinations that th
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/bitwise-and-of-numbers-range/ 题目: Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND o
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/peeking-iterator/ 题目: Given an Iterator class interface with methods: next() and hasNext(), design and implement
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/expression-add-operators/ 题目: Given a string that contains only digits 0-9 and a target value, return all possib
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/different-ways-to-add-parentheses/ 题目: Given a string of numbers and operators, return all possible results from
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/kth-largest-element-in-an-array/ 题目: Find the kth largest element in an unsorted array. Note that it is the kth
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/h-index-ii/ 题目: Given an array of citations sorted in ascending order (each citation is a non-negative integer)
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/h-index/ 题目: Given an array of citations (each citation is a non-negative integer) of a researcher, write a func
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/gray-code/ 题目: The gray code is a binary numeral system where two successive values differ in only one bit. Give
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/single-number-iii/ 题目: Given an array of numbers nums, in which exactly two elements appear only once and all th
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/word-pattern/ 题目: Given a pattern and a string str, find if str follows the same pattern. Here follow means a fu
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/nim-game/ 题目: You are playing the following Nim Game with your friend: There is a heap of stones on the table, e
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-consecutive-sequence/ 题目: Given an unsorted array of integers, find the length of the longest consecutiv
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/implement-trie-prefix-tree/ 题目: Implement a trie with insert, search, and startsWith methods. Note:You may assum
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/surrounded-regions/ 题目: Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded b
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/number-of-islands/ 题目: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An isla
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/word-ladder/ 题目: Given two words (beginWord and endWord), and a dictionary's word list, find the length of short
阅读全文
摘要:原题链接在这里:http://www.lintcode.com/en/problem/kth-largest-element/#在LeetCode上也有一道,采用了标准的quickSelect 方法,另外写了一篇帖子,代码更加模块化。采用的quickSelect方法,取出pivot, 比pivot ...
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/median-of-two-sorted-arrays/ 题目: here are two sorted arrays nums1 and nums2 of size m and n respectively. Find t
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/insert-interval/ 题目: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge i
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/merge-intervals/ 题目: Given a collection of intervals, merge all overlapping intervals. For example,Given [1,3],[
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/search-in-rotated-sorted-array-ii/ 题目: Follow up for "Search in Rotated Sorted Array":What if duplicates are all
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/description/ 题目: Given an array of integers sorted in as
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/search-insert-position/description/ 题目: Given a sorted array and a target value, return the index if the target
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/search-a-2d-matrix-ii/ 题目: Write an efficient algorithm that searches for a value in an m x n matrix. This matri
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/search-a-2d-matrix/ 题目: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix h
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/trapping-rain-water/ 题目: Given n non-negative integers representing an elevation map where the width of each bar
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/product-of-array-except-self/ 题目: Given an integer array nums, return an array answer such that answer[i] is equ
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/first-missing-positive/ 题目: Given an unsorted integer array, find the smallest missing positive integer. Example
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-the-duplicate-number/ 题目: Given an array nums containing n + 1 integers where each integer is between 1 and
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/missing-number/ 题目: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that i
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-peak-element/ 题目: A peak element is an element that is greater than its neighbors. Given an input array whe
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/copy-list-with-random-pointer/ 题目: A linked list is given such that each node contains an additional random poin
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/rotate-list/ 题目: Given a list, rotate the list to the right by k places, where k is non-negative. For example:Gi
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/merge-k-sorted-lists/ 题目: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/merge-two-sorted-lists/ 题目: Merge two sorted linked lists and return it as a new list. The new list should be ma
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/game-of-life/ 题目: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellu
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/set-matrix-zeroes/ 题目: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-pl
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-size-subarray-sum/ 题目: Given an array of n positive integers and a positive integer s, find the minimal
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/course-schedule-ii/ 题目: There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses m
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/course-schedule/description/ 题目: There are a total of n courses you have to take, labeled from 0 to n - 1. Some
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/clone-graph/description/ 题目: Given a reference of a node in a connected undirected graph. Return a deep copy (cl
阅读全文
摘要:1. BFS2. QuickSort3. PCA, 1000 articles, so many factors, how to reduce factors.4. newton's method5. multiple thread synchronized6. Design Pattern in ...
阅读全文
摘要:转自这篇帖子:http://www.importnew.com/7010.html HashMap和Hashtable的比较是Java面试中的常见问题,用来考验程序员是否能够正确使用集合类以及是否可以随机应变使用多种思路解决问题。HashMap的工作原理、ArrayList与Vector的比较以及这
阅读全文
摘要:转载自:http://www.cnblogs.com/springfor/p/4036739.htmlC++ supports pointers whereas Java does not. But when many programmers questioned how you can work ...
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/search-in-rotated-sorted-array/ 题目: Suppose an array sorted in ascending order is rotated at some pivot unknown
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/ 题目: Follow up for "Find Minimum in Rotated Sorted Array":What if duplic
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/description/ 题目: Suppose an array sorted in ascending order is rotated at s
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/sort-colors/ 题目: Given an array with n objects colored red, white or blue, sort them so that objects of the same
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/next-permutation/ 题目: Implement next permutation, which rearranges numbers into the lexicographically next great
阅读全文