摘要:
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,5,7], [4,1,8,3]
]
The minimum path sum from top to bottom is11(i.e.,2+3+5+1= 11).Note:Bonus point if you... 阅读全文
摘要:
Trapping Rain WaterMar 10 '12Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example,Given[0,1,0,2,1,0,1,3,2,1,2,1], return6.The above elevation map is represented by array [0,1,0,2,1,0,1,3,2, 阅读全文
摘要:
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 only one unique solution.A sudoku puzzle......and its solution numbers marked in red.uncompleted.public class Solution { ArrayList<HashSet< 阅读全文