2015年10月6日

53. Maximum Subarray (Array; DP)

摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2, 阅读全文

posted @ 2015-10-06 15:57 joannae 阅读(183) 评论(0) 推荐(0) 编辑

36. Valid Sudoku (Array; HashTable)

摘要: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled wit 阅读全文

posted @ 2015-10-06 13:29 joannae 阅读(220) 评论(0) 推荐(0) 编辑

37. Sudoku Solver (Array;Back-Track)

摘要: Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may assume that there will be 阅读全文

posted @ 2015-10-06 12:46 joannae 阅读(175) 评论(0) 推荐(0) 编辑

52. N-Queens II (Array; Back-Track)

摘要: Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 阅读全文

posted @ 2015-10-06 12:25 joannae 阅读(182) 评论(0) 推荐(0) 编辑

51. N-Queens (Array; Back-Track, Bit)

摘要: 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 阅读全文

posted @ 2015-10-06 12:22 joannae 阅读(194) 评论(0) 推荐(0) 编辑

导航