#31 Next Permutation. Medium #32 Longest Valid Parentheses. This Problem is similar to String Permutation in LintCode /** * Approach 1: Using Sorting -- (TLE) * Algorithm * The idea behind this approach is that one string will be a permutation of another string * only if both of them contain the same characters the same number of times. Given a list of numbers with duplicate number in it. Medium #37 Sudoku Solver. Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). Array. Medium. Hard #33 Search in Rotated Sorted Array. EPI. Medium #34 Find First and Last Position of Element in Sorted Array. Given the permutation [1, 4, 2, 2], return 3. Problem Statement. The index begins at 1. Here are some examples. Given the permutation [1, 4, 2, 2], return 3. Python; Question. Medium #34 Find First and Last Position of Element in Sorted Array. The index begins at 1. Easy #36 Valid Sudoku. Medium #35 Search Insert Position. LinkedIn. The replacement must be in-place and use only constant extra memory.. Backtracking 类型的题目,类似的题目还有Subsets, Permutations, Combination Sum, Palindrome Partioning ... Algorithm. Solution Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive 32-bit integer exists, you need to return -1.. // write your code here Question. Permutation Index II 198 Question. Easy #36 Valid Sudoku. Example; Note; 题解. * @return: All the combinations of k numbers out of 1..n. public List < List < Integer > > combine (int n, int k). lintcode. Hard #33 Search in Rotated Sorted Array. Medium #37 Sudoku Solver. 题解 Single Number. Hard #38 Count and Say. Example. Find all unique permutations. 【题目描述】 Given a list of integers, which denote a permutation.Find the previous permutation in ascending order.Notice:The list may contains duplicate integers.给定一个整数数组来表示排列,找出其… Medium #40 Combination Sum II. Medium #40 Combination Sum II. Medium #32 Longest Valid Parentheses. Medium #35 Search Insert Position. Problems coming from LeetCode, LintCode, TopCoder, CtCi, etc. #31 Next Permutation. Given a permutation which may contain repeated numbers, find its index in all the permutations of these numbers, which are ordered in lexicographical order. Easy #39 Combination Sum. Given a permutation which may contain repeated numbers, find its index in all the permutations of these numbers, which are ordered in lexicographical order. Medium. Hard #38 Count and Say. Example 1: Flatten Binary Tree to Linked List. Easy #39 Combination Sum. Next Permutation. House robber II. lintcode: (198) Permutation Index II; Problem Statement. Disclaimer: Under construction. Graph. Example.