摘要: This problem has three kinds of situations: 1. [0,0,1,1,1,] -> 0s start from i=0, the plant count = zeroNumber/2. 2.[1,0,0,0,1] -> 0s are in between 1 阅读全文
posted @ 2022-02-10 09:47 阳光明媚的菲越 阅读(19) 评论(0) 推荐(0) 编辑
摘要: My PriorityQueue solution, the time complexity is O(n+klog(k)) = O(nlog(n)). class IndexDistance{ int index; int distance; public IndexDistance(int a, 阅读全文
posted @ 2022-02-10 09:13 阳光明媚的菲越 阅读(18) 评论(0) 推荐(0) 编辑