摘要:
Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm sh... 阅读全文
摘要:
Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.Solution:The same as N-Quee... 阅读全文
摘要:
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 d... 阅读全文
摘要:
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Solution: 1 public class Solution { 2 pu... 阅读全文
摘要:
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from th... 阅读全文
摘要:
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatena... 阅读全文