上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 17 下一页
摘要: This problem can be solved by using two PriorityQueue(s), which is just the same solution as 295. Find Median from Data Stream. PriorityQueue<Integer> 阅读全文
posted @ 2022-02-25 03:41 阳光明媚的菲越 阅读(13) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2022-02-24 14:44 阳光明媚的菲越 阅读(0) 评论(0) 推荐(0) 编辑
摘要: So easy! public void merge(int[] nums1, int m, int[] nums2, int n) { int i = m-1, j = n-1, index = nums1.length-1; while(i>=0 && j>=0){ if(nums2[j]>=n 阅读全文
posted @ 2022-02-24 11:25 阳光明媚的菲越 阅读(14) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2022-02-24 08:45 阳光明媚的菲越 阅读(0) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2022-02-15 06:08 阳光明媚的菲越 阅读(0) 评论(0) 推荐(0) 编辑
摘要: This problem can be solved by bicket sorting. Although the problem only requires the number is 1~9, but my solution can be extended to any number sent 阅读全文
posted @ 2022-02-15 05:09 阳光明媚的菲越 阅读(27) 评论(0) 推荐(0) 编辑
摘要: This is a super easy problem. Time Compexity O(n), Space Complexity O(n) int res = 0; public int getDecimalValue(ListNode head) { if(head==null) retur 阅读全文
posted @ 2022-02-15 05:02 阳光明媚的菲越 阅读(17) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2022-02-11 13:53 阳光明媚的菲越 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 17 下一页