Stack
文章平均质量分 67
liujunlovecs
这个作者很懒,什么都没留下…
展开
-
Leetcode#20||Valid Parentheses
public class Solution { public boolean isValid(String s) { Map map = new HashMap(); map.put('(', ')'); map.put('[', ']'); map.put('{', '}'); Stack原创 2015-08-12 12:28:51 · 220 阅读 · 0 评论 -
Leetcode#42||Trapping Rain Water
public class Solution { public int trap(int[] height) { if (height == null || height.length < 3) { return 0; } int result = 0; int maxHeightInd原创 2015-08-15 09:09:25 · 204 阅读 · 0 评论 -
Largest Rectangle in Histogram
public class Solution { public int largestRectangleArea(int[] height) { if (height == null || height.length == 0) { return 0; } Stack s = new Stack();原创 2015-08-07 10:07:27 · 274 阅读 · 0 评论 -
Maximal Rectangle
public class Solution { public int maximalRectangle(char[][] matrix) { if (matrix == null || matrix.length == 0 || matrix[0].length == 0) { return 0; } int row原创 2015-08-07 10:34:16 · 322 阅读 · 0 评论