摘要:
Problem : The n queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Solution (C++) : 阅读全文
摘要:
Problem : Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Example 2: 思路 : 每次遍历从左上角 阅读全文
摘要:
Problem : Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules : 1. Each of 阅读全文
摘要:
Problem : Given a collection of candidate numbers ( ) and a target number ( ), find all unique combinations in where the candidate numbers sums to . E 阅读全文
摘要:
Problem : Given n non negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap afte 阅读全文
摘要:
Problem : Given an array of non negative integers, you are initially positioned at the first index of the array. Each element in the array represents 阅读全文