原创 #51 Previous Permutation

題目描述: Given a list of integers, which denote a permutation. Find the previous permutation in ascending order.  Not

原创 #1 A + B Problem

題目描述: Write a function that add two numbers A and B. You should not use + or any arithmetic operators.   Notice

原创 #12 Min Stack

題目描述: Implement a stack with min() function, which will return the smallest number in the stack. It should support p

原创 #30 Insert Interval

題目描述: Given a non-overlapping interval list which is sorted by start point. Insert a new interval into it, make sure

原创 #6 Merge Two Sorted Arrays

題目描述: Merge two given sorted integer array A and B into a new sorted integer array. Have you met this question in

原创 #5 Kth Largest Element

題目描述: Find K-th largest element in an array.  Notice You can swap elements in the array Have you met this que

原创 #3 Digit Counts

題目描述: Count the number of k's between 0 and n. k can be 0 - 9. Have you met this question in a real interview?  Y

原创 #40 Implement Queue by Two Stacks

題目描述: As the title described, you should only use two stacks to implement a queue's actions. The queue should suppor

原创 #32 Minimum Window Substring

題目描述: Given a string source and a string target, find the minimum window in source which will contain all the charac

原创 #29 Interleaving String

題目描述: Given three strings: s1, s2, s3, determine whether s3 is formed by the interleaving of s1 and s2. Have you m

原创 #42 Maximum Subarray II

題目描述: Given an array of integers, find two non-overlapping subarrays which have the largest sum. The number in each

原创 #34 N-Queens II

題目描述: Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of disti

原创 #15 Permutations

題目描述: Given a list of numbers, return all possible permutations.  Notice You can assume that there is no duplicat

原创 #39 Recover Rotated Sorted Array

題目描述: Given a rotated sorted array, recover it to sorted array in-place. Have you met this question in a real inte

原创 #33 N-Queens

題目描述: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack ea