Skip to content

Commit f5982f9

Browse files
authored
Updated readme
1 parent 8a38bbd commit f5982f9

File tree

2 files changed

+18
-22
lines changed
  • src/main/kotlin/g0601_0700/s0689_maximum_sum_of_3_non_overlapping_subarrays

2 files changed

+18
-22
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ implementation 'com.github.javadev:leetcode-in-kotlin:1.9'
190190

191191
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
192192
|-|-|-|-|-|-
193-
| 0695 |[Max Area of Island](src/main/kotlin/g0601_0700/s0695_max_area_of_island/Solution.kt)| |||
193+
| 0695 |[Max Area of Island](src/main/kotlin/g0601_0700/s0695_max_area_of_island/Solution.kt)| Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 324 | 24.06
194194

195195
#### Day 3 Matrix Related Problems
196196

@@ -1059,7 +1059,7 @@ implementation 'com.github.javadev:leetcode-in-kotlin:1.9'
10591059

10601060
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
10611061
|-|-|-|-|-|-
1062-
| 0695 |[Max Area of Island](src/main/kotlin/g0601_0700/s0695_max_area_of_island/Solution.kt)| |||
1062+
| 0695 |[Max Area of Island](src/main/kotlin/g0601_0700/s0695_max_area_of_island/Solution.kt)| Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 324 | 24.06
10631063

10641064
#### Day 8 Breadth First Search Depth First Search
10651065

@@ -1685,7 +1685,7 @@ implementation 'com.github.javadev:leetcode-in-kotlin:1.9'
16851685
| 0692 |[Top K Frequent Words](src/main/kotlin/g0601_0700/s0692_top_k_frequent_words/Solution.kt)| Medium | String, Hash_Table, Sorting, Heap_Priority_Queue, Counting, Trie, Bucket_Sort, Level_1_Day_15_Heap | 239 | 81.10
16861686
| 0691 |[Stickers to Spell Word](src/main/kotlin/g0601_0700/s0691_stickers_to_spell_word/Solution.kt)| Hard | Array, String, Dynamic_Programming, Bit_Manipulation, Backtracking, Bitmask | 249 | 100.00
16871687
| 0690 |[Employee Importance](src/main/kotlin/g0601_0700/s0690_employee_importance/Solution.kt)| Medium | Hash_Table, Depth_First_Search, Breadth_First_Search | 255 | 100.00
1688-
| 0689 |[Knight Probability in Chessboard](src/main/kotlin/g0601_0700/s0689_maximum_sum_of_3_non_overlapping_subarrays/Solution.kt)| Hard | Array, Dynamic_Programming | 248 | 100.00
1688+
| 0689 |[Maximum Sum of 3 Non-Overlapping Subarrays](src/main/kotlin/g0601_0700/s0689_maximum_sum_of_3_non_overlapping_subarrays/Solution.kt)| Hard | Array, Dynamic_Programming | 248 | 100.00
16891689
| 0688 |[Knight Probability in Chessboard](src/main/kotlin/g0601_0700/s0688_knight_probability_in_chessboard/Solution.kt)| Medium | Dynamic_Programming | 144 | 100.00
16901690
| 0687 |[Longest Univalue Path](src/main/kotlin/g0601_0700/s0687_longest_univalue_path/Solution.kt)| Medium | Depth_First_Search, Tree, Binary_Tree | 303 | 100.00
16911691
| 0686 |[Repeated String Match](src/main/kotlin/g0601_0700/s0686_repeated_string_match/Solution.kt)| Medium | String, String_Matching | 164 | 100.00
Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
1-
688\. Knight Probability in Chessboard
1+
689\. Maximum Sum of 3 Non-Overlapping Subarrays
22

3-
Medium
3+
Hard
44

5-
On an `n x n` chessboard, a knight starts at the cell `(row, column)` and attempts to make exactly `k` moves. The rows and columns are **0-indexed**, so the top-left cell is `(0, 0)`, and the bottom-right cell is `(n - 1, n - 1)`.
5+
Given an integer array `nums` and an integer `k`, find three non-overlapping subarrays of length `k` with maximum sum and return them.
66

7-
A chess knight has eight possible moves it can make, as illustrated below. Each move is two cells in a cardinal direction, then one cell in an orthogonal direction.
7+
Return the result as a list of indices representing the starting position of each interval (**0-indexed**). If there are multiple answers, return the lexicographically smallest one.
88

9-
![](https://assets.leetcode.com/uploads/2018/10/12/knight.png)
10-
11-
Each time the knight is to move, it chooses one of eight possible moves uniformly at random (even if the piece would go off the chessboard) and moves there.
12-
13-
The knight continues moving until it has made exactly `k` moves or has moved off the chessboard.
9+
**Example 1:**
1410

15-
Return _the probability that the knight remains on the board after it has stopped moving_.
11+
**Input:** nums = [1,2,1,2,6,7,5,1], k = 2
1612

17-
**Example 1:**
13+
**Output:** [0,3,5]
1814

19-
**Input:** n = 3, k = 2, row = 0, column = 0
15+
**Explanation:**
2016

21-
**Output:** 0.06250
17+
Subarrays [1, 2], [2, 6], [7, 5] correspond to the starting indices [0, 3, 5].
2218

23-
**Explanation:** There are two moves (to (1,2), (2,1)) that will keep the knight on the board. From each of those positions, there are also two moves that will keep the knight on the board. The total probability the knight stays on the board is 0.0625.
19+
We could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically larger.
2420

2521
**Example 2:**
2622

27-
**Input:** n = 1, k = 0, row = 0, column = 0
23+
**Input:** nums = [1,2,1,2,1,2,1,2,1], k = 2
2824

29-
**Output:** 1.00000
25+
**Output:** [0,2,4]
3026

3127
**Constraints:**
3228

33-
* `1 <= n <= 25`
34-
* `0 <= k <= 100`
35-
* `0 <= row, column <= n - 1`
29+
* <code>1 <= nums.length <= 2 * 10<sup>4</sup></code>
30+
* <code>1 <= nums[i] < 2<sup>16</sup></code>
31+
* `1 <= k <= floor(nums.length / 3)`

0 commit comments

Comments
 (0)