摘要:
https://leetcode.com/problems/mini-parser/ /** * // This is the interface that allows for creating nested lists. * // You should not implement it, or speculate about its implementation * public i... 阅读全文
posted @ 2016-08-28 23:31
blcblc
阅读(331)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/shuffle-an-array/ public class Solution { int [] origNums; int [] shufNums; java.util.Random rd; public Solution(int[] nums) { origNums = nums... 阅读全文
posted @ 2016-08-28 16:05
blcblc
阅读(161)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/ransom-note/ public class Solution { public boolean canConstruct(String ransomNote, String magazine) { char[] chRan = ransomNote.toCharArray(); char... 阅读全文
posted @ 2016-08-28 12:10
blcblc
阅读(150)
评论(0)
推荐(0)
摘要:
https://leetcode.com/problems/linked-list-random-node/ // Using Reservoir sampling algorithm // https://discuss.leetcode.com/topic/53812/using-reservoir-sampling-o-1-space-o-n-time-complexity-c/2 /... 阅读全文
posted @ 2016-08-28 11:24
blcblc
阅读(212)
评论(0)
推荐(0)