Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8183fd6

Browse filesBrowse files
author
night
committed
add doc
1 parent b20d5fb commit 8183fd6
Copy full SHA for 8183fd6

File tree

2 files changed

+8
-0
lines changed
Filter options

2 files changed

+8
-0
lines changed

‎note/315/README.md

Copy file name to clipboardExpand all lines: note/315/README.md
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ To the right of 1 there is 0 smaller element.
2222
那么 j 左侧的元素个数总共有 (mid+1..j-1) = j - 1 - mid - 1 + 1 = j - mid - 1
2323
那 res[indexes[i]] += j - mid -1
2424

25+
T: O(N*logN)
26+
S: O(N)
2527
```kotlin
2628
class Solution {
2729
var copy = intArrayOf()

‎note/410/README.md

Copy file name to clipboardExpand all lines: note/410/README.md
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ Output: 18
2626
left <= right. 如果满足条件 right = mid - 1, 否则 left = mid + 1.
2727
最后退出循环条件的 left 就是最小值。类似搜索插入位置那道题。
2828

29+
3. check 的逻辑
30+
模拟计算每个子数组的和, 如果发现 count 超过 k, 或者其中某个元素比 sum 都要大时, 返回 false, 表明当前的值小了。
31+
32+
T: O(N*logSum) N:是元素长度, Sum 是所有元素之和
33+
S: O(1)
34+
2935
```kotlin
3036
package com.blankj.hard._410
3137

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.