You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: solution/2200-2299/2200.Find All K-Distant Indices in an Array/README_EN.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ Hence, we return [0,1,2,3,4].
48
48
49
49
**Solution 1: Enumeration**
50
50
51
-
We enumerate the index $i$ in the range $[0, n),ドル and for each index $i,ドル we enumerate the index $j$ in the range $[0, n)$. If $|i - j| \leq k$ and $nums[j] == key,ドル then $i$ is a K-nearest neighbor index. We add $i$ to the answer array, then break the inner loop and enumerate the next index $i$.
51
+
We enumerate the index $i$ in the range $[0, n),ドル and for each index $i,ドル we enumerate the index $j$ in the range $[0, n)$. If $|i - j| \leq k$ and $nums[j] = key,ドル then $i$ is a K-nearest neighbor index. We add $i$ to the answer array, then break the inner loop and enumerate the next index $i$.
52
52
53
53
The time complexity is $O(n^2),ドル where $n$ is the length of the array $nums$. The space complexity is $O(1)$.
54
54
Collapse file: solution/2200-2299/2201.Count Artifacts That Can Be Extracted/README.md
0 commit comments