Reverse a linked list from position m to n. Do it in one-pass.
Note: 1 ≤ m ≤ n ≤ length of list.
EX:
Input: 1->2->3->4->5->NULL, m = 2, n = 4
Output: 1->4->3->2->5->NULL
Reverse a linked list from position m to n. Do it in one-pass.
Note: 1 ≤ m ≤ n ≤ length of list.
EX:
Input: 1->2->3->4->5->NULL, m = 2, n = 4
Output: 1->4->3->2->5->NULL
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
EX:
Input: [-2,1,-3,4,-1,2,1,-5,4],
Output: 6
Explanation: [4,-1,2,1] has the largest sum = 6.
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.

Given an integer n, return the number of distinct solutions to the n-queens puzzle.
EX:
Input: 4
Output: 2 Explanation: There are two distinct solutions to the 4-queens puzzle as shown below. [ [".Q..", // Solution 1 "...Q", "Q...", "..Q."], ["..Q.", // Solution 2 "Q...", "...Q", ".Q.."] ]
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.

Given an integer n, return all distinct solutions to the n-queens puzzle.
Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a queen and an empty space respectively.
EX:
Input: 4
Output: [ [".Q..", // Solution 1 "...Q", "Q...", "..Q."], ["..Q.", // Solution 2 "Q...", "...Q", ".Q.."] ] Explanation: There exist two distinct solutions to the 4-queens puzzle as shown above.
Implement pow(x, n), which calculates x raised to the power n (xn).
EX:
Input: 2.00000, 10
Output: 1024.00000
Input: 2.00000, -2Output: 0.25000 Explanation: 2-2 = 1/22 = 1/4 = 0.25
這題給定一個 array 包含一些 string,要求我們將由同樣字元組成的 string 歸到同一個 array。
EX:
Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
Output: [ ["ate","eat","tea"], ["nat","tan"], ["bat"] ]
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Note:
You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.
EX:
Given input matrix =
[ [1,2,3], [4,5,6], [7,8,9] ], rotate the input matrix in-place such that it becomes: [ [7,4,1], [8,5,2], [9,6,3] ]
Output: [ [1,1,2], [1,2,1], [2,1,1] ]
Given a collection of distinct integers, return all possible permutations.
EX:
Input: [1,2,3]
Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ]
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character. '*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).
Note:
s could be empty and contains only lowercase letters a-z.p could be empty and contains only lowercase letters a-z, and characters like ? or *.s = "adceb" p = "*a*b" Output: true Explanation: The first '*' matches the empty sequence, while the second '*' matches the substring "dce".
num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Output: "56088"
Given an unsorted integer array, find the smallest missing positive integer.
EX:
Input: [1,2,0]
Output: 3
Input: [3,4,-1,1] Output: 2 Input: [7,8,9,11,12] Output: 1
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.
Each number in candidates may only be used once in the combination.
Note:
target) will be positive integers.[10,1,2,7,6,1,5], target = 8,A solution set is: [ [1, 7], [1, 2, 5], [2, 6], [1, 1, 6] ]