2019年3月19日
摘要: I hate geometric problems…... java class Solution { public int minAreaRect(int[][] points) { Map xmap = new HashMap(); Map ymap = new HashMap(); Set s 阅读全文
posted @ 2019-03-19 21:24 王 帅 阅读(93) 评论(0) 推荐(0) 编辑
摘要: dont know why, but I prefer to use for instead of while. 阅读全文
posted @ 2019-03-19 21:23 王 帅 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Keep two int variable to record min and max value, when encounter I, use max++ value, on the contrary, use min . At last, add (min + 1) to all element 阅读全文
posted @ 2019-03-19 21:22 王 帅 阅读(57) 评论(0) 推荐(0) 编辑
摘要: It is marked as easy, and it's really very easy. 阅读全文
posted @ 2019-03-19 21:20 王 帅 阅读(71) 评论(0) 推荐(0) 编辑
摘要: Just use a stack to simulate the push and pop process While stack is empty or peek does not equal to popped current value, push value into stack. Whil 阅读全文
posted @ 2019-03-19 21:19 王 帅 阅读(140) 评论(0) 推荐(0) 编辑
  2019年3月18日
摘要: 947. Most Stones Removed with Same Row or Column Find connected components, with some specific connected component, the remove count is Num of element 阅读全文
posted @ 2019-03-18 23:17 王 帅 阅读(209) 评论(0) 推荐(0) 编辑
  2019年3月17日
摘要: leetcode 953. Verifying an Alien Dictionary 949. Largest Time for Given Digits 948. Bag of Tokens Greedy solution: 1. Sort tokens first. 2. At each lo 阅读全文
posted @ 2019-03-17 17:38 王 帅 阅读(127) 评论(0) 推荐(0) 编辑
  2019年3月16日
摘要: 957 Prison Cells After N Days The first intuition is that, after first day, the first and last cell will be vacant. So there'll be 2^6 = 64 total stat 阅读全文
posted @ 2019-03-16 21:19 王 帅 阅读(179) 评论(0) 推荐(0) 编辑
摘要: For problems which need to find the least moves to some target, just breath first search. And keep three variables while searching: 1. visited node to 阅读全文
posted @ 2019-03-16 14:57 王 帅 阅读(168) 评论(0) 推荐(0) 编辑
  2019年3月14日
摘要: leetcode 1007 Minimum Domino Rotations For Equal Row Use three int array of size 6 The first one invalid array records valid(or invalid) numbers which 阅读全文
posted @ 2019-03-14 22:14 王 帅 阅读(104) 评论(0) 推荐(0) 编辑