Skip to content

Commit 560fecb

Browse files
authored
Added tasks 2618-2706
1 parent da2e97f commit 560fecb

File tree

55 files changed

+2357
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2357
-89
lines changed

README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,9 +1816,39 @@
18161816

18171817
| # | Title | Difficulty | Tag | Time, ms | Time, %
18181818
|------|----------------|-------------|-------------|----------|--------
1819+
| 2706 |[Buy Two Chocolates](src/main/kotlin/g2701_2800/s2706_buy_two_chocolates)| Easy | Array, Sorting | 187 | 96.43
1820+
| 2705 |[Compact Object](src/main/kotlin/g2701_2800/s2705_compact_object)| Medium || 78 | 99.38
1821+
| 2704 |[To Be Or Not To Be](src/main/kotlin/g2701_2800/s2704_to_be_or_not_to_be)| Easy || 49 | 97.88
1822+
| 2703 |[Return Length of Arguments Passed](src/main/kotlin/g2701_2800/s2703_return_length_of_arguments_passed)| Easy || 47 | 98.59
1823+
| 2699 |[Modify Graph Edge Weights](src/main/kotlin/g2601_2700/s2699_modify_graph_edge_weights)| Hard | Heap_Priority_Queue, Graph, Shortest_Path | 1592 | 40.00
1824+
| 2698 |[Find the Punishment Number of an Integer](src/main/kotlin/g2601_2700/s2698_find_the_punishment_number_of_an_integer)| Medium | Math, Backtracking | 133 | 100.00
1825+
| 2697 |[Lexicographically Smallest Palindrome](src/main/kotlin/g2601_2700/s2697_lexicographically_smallest_palindrome)| Easy | String, Two_Pointers | 267 | 100.00
1826+
| 2696 |[Minimum String Length After Removing Substrings](src/main/kotlin/g2601_2700/s2696_minimum_string_length_after_removing_substrings)| Easy | String, Stack, Simulation | 185 | 100.00
1827+
| 2695 |[Array Wrapper](src/main/kotlin/g2601_2700/s2695_array_wrapper)| Easy || 40 | 100.00
1828+
| 2694 |[Event Emitter](src/main/kotlin/g2601_2700/s2694_event_emitter)| Medium || 45 | 99.58
1829+
| 2693 |[Call Function with Custom Context](src/main/kotlin/g2601_2700/s2693_call_function_with_custom_context)| Medium | Array, Dynamic_Programming, Matrix | 51 | 97.92
1830+
| 2685 |[Count the Number of Complete Components](src/main/kotlin/g2601_2700/s2685_count_the_number_of_complete_components)| Medium | Array, Dynamic_Programming, Depth_First_Search, Breadth_First_Search, Matrix, Graph | 436 | 100.00
1831+
| 2684 |[Maximum Number of Moves in a Grid](src/main/kotlin/g2601_2700/s2684_maximum_number_of_moves_in_a_grid)| Medium | Array, Dynamic_Programming, Matrix | 542 | 100.00
1832+
| 2683 |[Neighboring Bitwise XOR](src/main/kotlin/g2601_2700/s2683_neighboring_bitwise_xor)| Medium | Array, Bit_Manipulation | 988 | 100.00
1833+
| 2682 |[Find the Losers of the Circular Game](src/main/kotlin/g2601_2700/s2682_find_the_losers_of_the_circular_game)| Easy | Array, Hash_Table, Simulation | 186 | 100.00
1834+
| 2681 |[Power of Heroes](src/main/kotlin/g2601_2700/s2681_power_of_heroes)| Hard | Array, Math, Sorting, Prefix_Sum | 454 | 85.71
1835+
| 2680 |[Maximum OR](src/main/kotlin/g2601_2700/s2680_maximum_or)| Medium | Array, Greedy, Bit_Manipulation, Prefix_Sum | 592 | 90.91
1836+
| 2679 |[Sum in a Matrix](src/main/kotlin/g2601_2700/s2679_sum_in_a_matrix)| Medium | Array, Sorting, Matrix, Heap_Priority_Queue, Simulation | 581 | 100.00
1837+
| 2678 |[Number of Senior Citizens](src/main/kotlin/g2601_2700/s2678_number_of_senior_citizens)| Easy | Array, String | 163 | 96.30
1838+
| 2677 |[Chunk Array](src/main/kotlin/g2601_2700/s2677_chunk_array)| Easy || 55 | 96.89
1839+
| 2673 |[Make Costs of Paths Equal in a Binary Tree](src/main/kotlin/g2601_2700/s2673_make_costs_of_paths_equal_in_a_binary_tree)| Medium | Array, Dynamic_Programming, Greedy, Tree, Binary_Tree | 645 | 75.00
1840+
| 2672 |[Number of Adjacent Elements With the Same Color](src/main/kotlin/g2601_2700/s2672_number_of_adjacent_elements_with_the_same_color)| Medium | Array | 1208 | 100.00
1841+
| 2671 |[Frequency Tracker](src/main/kotlin/g2601_2700/s2671_frequency_tracker)| Medium | Hash_Table, Design | 1109 | 80.00
1842+
| 2670 |[Find the Distinct Difference Array](src/main/kotlin/g2601_2700/s2670_find_the_distinct_difference_array)| Easy | Array, Hash_Table | 320 | 94.74
1843+
| 2667 |[Create Hello World Function](src/main/kotlin/g2601_2700/s2667_create_hello_world_function)| Easy || 52 | 92.72
1844+
| 2666 |[Allow One Function Call](src/main/kotlin/g2601_2700/s2666_allow_one_function_call)| Easy || 53 | 93.29
1845+
| 2665 |[Counter II](src/main/kotlin/g2601_2700/s2665_counter_ii)| Easy || 65 | 86.59
1846+
| 2663 |[Lexicographically Smallest Beautiful String](src/main/kotlin/g2601_2700/s2663_lexicographically_smallest_beautiful_string)| Hard | String, Greedy | 324 | 100.00
1847+
| 2662 |[Minimum Cost of a Path With Special Roads](src/main/kotlin/g2601_2700/s2662_minimum_cost_of_a_path_with_special_roads)| Medium | Array, Heap_Priority_Queue, Graph, Shortest_Path | 690 | 100.00
1848+
| 2661 |[First Completely Painted Row or Column](src/main/kotlin/g2601_2700/s2661_first_completely_painted_row_or_column)| Medium | Array, Hash_Table, Matrix | 901 | 100.00
18191849
| 2660 |[Determine the Winner of a Bowling Game](src/main/kotlin/g2601_2700/s2660_determine_the_winner_of_a_bowling_game)| Easy | Array, Simulation | 263 | 85.71
18201850
| 2659 |[Make Array Empty](src/main/kotlin/g2601_2700/s2659_make_array_empty)| Hard | Array, Sorting, Greedy, Binary_Search, Ordered_Set, Segment_Tree, Binary_Indexed_Tree | 728 | 100.00
1821-
| 2658 |[Maximum Number of Fish in a Grid](src/main/kotlin/g2601_2700/s2658_maximum_number_of_fish_in_a_grid)| Medium | Array, Matrix, Union_Find, Depth_First_Search, Breadth_First_Search | 269 | 80.00
1851+
| 2658 |[Maximum Number of Fish in a Grid](src/main/kotlin/g2601_2700/s2658_maximum_number_of_fish_in_a_grid)| Medium | Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find | 269 | 80.00
18221852
| 2657 |[Find the Prefix Common Array of Two Arrays](src/main/kotlin/g2601_2700/s2657_find_the_prefix_common_array_of_two_arrays)| Medium | Array, Hash_Table | 288 | 88.89
18231853
| 2656 |[Maximum Sum With Exactly K Elements](src/main/kotlin/g2601_2700/s2656_maximum_sum_with_exactly_k_elements)| Easy | Array, Greedy | 241 | 93.94
18241854
| 2654 |[Minimum Number of Operations to Make All Array Elements Equal to 1](src/main/kotlin/g2601_2700/s2654_minimum_number_of_operations_to_make_all_array_elements_equal_to_1)| Medium | Array, Math, Number_Theory | 172 | 100.00
@@ -1828,12 +1858,12 @@
18281858
| 2650 |[Design Cancellable Function](src/main/kotlin/g2601_2700/s2650_design_cancellable_function)| Hard || 58 | 95.56
18291859
| 2649 |[Nested Array Generator](src/main/kotlin/g2601_2700/s2649_nested_array_generator)| Medium || 192 | 70.11
18301860
| 2648 |[Generate Fibonacci Sequence](src/main/kotlin/g2601_2700/s2648_generate_fibonacci_sequence)| Easy || 53 | 93.66
1831-
| 2646 |[Minimize the Total Price of the Trips](src/main/kotlin/g2601_2700/s2646_minimize_the_total_price_of_the_trips)| Hard | Array, Dynamic_Programming, Tree, Graph, Depth_First_Search | 264 | 100.00
1861+
| 2646 |[Minimize the Total Price of the Trips](src/main/kotlin/g2601_2700/s2646_minimize_the_total_price_of_the_trips)| Hard | Array, Dynamic_Programming, Depth_First_Search, Tree, Graph | 264 | 100.00
18321862
| 2645 |[Minimum Additions to Make Valid String](src/main/kotlin/g2601_2700/s2645_minimum_additions_to_make_valid_string)| Medium | String, Dynamic_Programming, Greedy, Stack | 154 | 100.00
18331863
| 2644 |[Find the Maximum Divisibility Score](src/main/kotlin/g2601_2700/s2644_find_the_maximum_divisibility_score)| Easy | Array | 585 | 100.00
18341864
| 2643 |[Row With Maximum Ones](src/main/kotlin/g2601_2700/s2643_row_with_maximum_ones)| Easy | Array, Matrix | 530 | 100.00
18351865
| 2642 |[Design Graph With Shortest Path Calculator](src/main/kotlin/g2601_2700/s2642_design_graph_with_shortest_path_calculator)| Hard | Design, Heap_Priority_Queue, Graph, Shortest_Path | 789 | 100.00
1836-
| 2641 |[Cousins in Binary Tree II](src/main/kotlin/g2601_2700/s2641_cousins_in_binary_tree_ii)| Medium | Hash_Table, Tree, Binary_Tree, Depth_First_Search, Breadth_First_Search | 922 | 90.91
1866+
| 2641 |[Cousins in Binary Tree II](src/main/kotlin/g2601_2700/s2641_cousins_in_binary_tree_ii)| Medium | Hash_Table, Depth_First_Search, Breadth_First_Search, Tree, Binary_Tree | 922 | 90.91
18371867
| 2640 |[Find the Score of All Prefixes of an Array](src/main/kotlin/g2601_2700/s2640_find_the_score_of_all_prefixes_of_an_array)| Medium | Array, Prefix_Sum | 587 | 100.00
18381868
| 2639 |[Find the Width of Columns of a Grid](src/main/kotlin/g2601_2700/s2639_find_the_width_of_columns_of_a_grid)| Easy | Array, Matrix | 222 | 100.00
18391869
| 2637 |[Promise Time Limit](src/main/kotlin/g2601_2700/s2637_promise_time_limit)| Easy || 64 | 75.36
@@ -1856,11 +1886,11 @@
18561886
| 2616 |[Minimize the Maximum Difference of Pairs](src/main/kotlin/g2601_2700/s2616_minimize_the_maximum_difference_of_pairs)| Medium | Array, Greedy, Binary_Search | 556 | 100.00
18571887
| 2615 |[Sum of Distances](src/main/kotlin/g2601_2700/s2615_sum_of_distances)| Medium | Array, Hash_Table, Prefix_Sum | 902 | 100.00
18581888
| 2614 |[Prime In Diagonal](src/main/kotlin/g2601_2700/s2614_prime_in_diagonal)| Easy | Array, Math, Matrix, Number_Theory | 465 | 100.00
1859-
| 2612 |[Minimum Reverse Operations](src/main/kotlin/g2601_2700/s2612_minimum_reverse_operations)| Hard | Array, Ordered_Set, Breadth_First_Search | 923 | 100.00
1889+
| 2612 |[Minimum Reverse Operations](src/main/kotlin/g2601_2700/s2612_minimum_reverse_operations)| Hard | Array, Breadth_First_Search, Ordered_Set | 923 | 100.00
18601890
| 2611 |[Mice and Cheese](src/main/kotlin/g2601_2700/s2611_mice_and_cheese)| Medium | Array, Sorting, Greedy, Heap_Priority_Queue | 554 | 100.00
18611891
| 2610 |[Convert an Array Into a 2D Array With Conditions](src/main/kotlin/g2601_2700/s2610_convert_an_array_into_a_2d_array_with_conditions)| Medium | Array, Hash_Table | 240 | 88.24
18621892
| 2609 |[Find the Longest Balanced Substring of a Binary String](src/main/kotlin/g2601_2700/s2609_find_the_longest_balanced_substring_of_a_binary_string)| Easy | String | 174 | 100.00
1863-
| 2608 |[Shortest Cycle in a Graph](src/main/kotlin/g2601_2700/s2608_shortest_cycle_in_a_graph)| Hard | Graph, Breadth_First_Search | 1061 | 100.00
1893+
| 2608 |[Shortest Cycle in a Graph](src/main/kotlin/g2601_2700/s2608_shortest_cycle_in_a_graph)| Hard | Breadth_First_Search, Graph | 1061 | 100.00
18641894
| 2607 |[Make K-Subarray Sums Equal](src/main/kotlin/g2601_2700/s2607_make_k_subarray_sums_equal)| Medium | Array, Math, Sorting, Number_Theory | 1062 | 100.00
18651895
| 2606 |[Find the Substring With Maximum Cost](src/main/kotlin/g2601_2700/s2606_find_the_substring_with_maximum_cost)| Medium | Array, String, Hash_Table, Dynamic_Programming | 238 | 100.00
18661896
| 2605 |[Form Smallest Number From Two Digit Arrays](src/main/kotlin/g2601_2700/s2605_form_smallest_number_from_two_digit_arrays)| Easy | Array, Hash_Table, Enumeration | 161 | 100.00

src/main/kotlin/g0001_0100/s0020_valid_parentheses/readme.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,19 @@ An input string is valid if:
5050
## Solution
5151

5252
```kotlin
53-
import java.util.Stack
54-
5553
class Solution {
5654
fun isValid(s: String): Boolean {
57-
val stack = Stack<Char>()
55+
val stack = ArrayDeque<Char>()
5856
for (element in s) {
5957
val c = element
6058
if (c == '(' || c == '[' || c == '{') {
61-
stack.push(c)
62-
} else if (c == ')' && stack.isNotEmpty() && stack.peek() == '(') {
63-
stack.pop()
64-
} else if (c == '}' && stack.isNotEmpty() && stack.peek() == '{') {
65-
stack.pop()
66-
} else if (c == ']' && stack.isNotEmpty() && stack.peek() == '[') {
67-
stack.pop()
59+
stack.addLast(c)
60+
} else if (c == ')' && stack.isNotEmpty() && stack.last() == '(') {
61+
stack.removeLast()
62+
} else if (c == '}' && stack.isNotEmpty() && stack.last() == '{') {
63+
stack.removeLast()
64+
} else if (c == ']' && stack.isNotEmpty() && stack.last() == '[') {
65+
stack.removeLast()
6866
} else {
6967
return false
7068
}

src/main/kotlin/g0001_0100/s0077_combinations/readme.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,18 @@ You may return the answer in **any order**.
3333
## Solution
3434

3535
```kotlin
36-
import java.util.Stack
37-
3836
class Solution {
3937
fun combine(n: Int, k: Int): List<List<Int>> {
4038
val ans: MutableList<List<Int>> = ArrayList()
4139
// Boundary case
4240
if (n > 20 || k < 1 || k > n) {
4341
return ans
4442
}
45-
backtrack(ans, n, k, 1, Stack())
43+
backtrack(ans, n, k, 1, ArrayDeque())
4644
return ans
4745
}
4846

49-
private fun backtrack(ans: MutableList<List<Int>>, n: Int, k: Int, s: Int, stack: Stack<Int>) {
47+
private fun backtrack(ans: MutableList<List<Int>>, n: Int, k: Int, s: Int, stack: ArrayDeque<Int>) {
5048
// Base case
5149
// If k becomes 0
5250
if (k == 0) {
@@ -55,10 +53,10 @@ class Solution {
5553
}
5654
// Start with s till n-k+1
5755
for (i in s..n - k + 1) {
58-
stack.push(i)
56+
stack.addLast(i)
5957
// Update start for recursion and decrease k by 1
6058
backtrack(ans, n, k - 1, i + 1, stack)
61-
stack.pop()
59+
stack.removeLast()
6260
}
6361
}
6462
}

src/main/kotlin/g0101_0200/s0144_binary_tree_preorder_traversal/readme.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Given the `root` of a binary tree, return _the preorder traversal of its nodes'
3838

3939
```kotlin
4040
import com_github_leetcode.TreeNode
41-
import java.util.Stack
4241

4342
/*
4443
* Example:
@@ -56,15 +55,15 @@ class Solution {
5655
if (root == null) {
5756
return result
5857
}
59-
val stack: Stack<TreeNode> = Stack<TreeNode>()
58+
val stack: ArrayDeque<TreeNode?> = ArrayDeque()
6059
var current: TreeNode? = root
6160
while (current != null || stack.isNotEmpty()) {
6261
while (current != null) {
6362
result.add(current.`val`)
64-
stack.push(current.right)
63+
stack.addLast(current.right)
6564
current = current.left
6665
}
67-
current = stack.pop()
66+
current = stack.removeLast()
6867
}
6968
return result
7069
}

src/main/kotlin/g0101_0200/s0155_min_stack/readme.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,28 @@ Implement the `MinStack` class:
4444
## Solution
4545

4646
```kotlin
47-
import java.util.Stack
48-
4947
class MinStack() {
50-
private val stack: Stack<Pair<Int, Int>> = Stack()
48+
private val stack: ArrayDeque<Pair<Int, Int>> = ArrayDeque()
5149

5250
fun push(x: Int) {
5351
val min: Int = if (stack.isEmpty()) x
5452
else getMin()
55-
56-
stack.push(x to minOf(min, x))
53+
stack.addLast(x to minOf(min, x))
5754
}
5855

5956
fun pop() {
60-
stack.pop()
57+
stack.removeLast()
6158
}
6259

6360
fun top(): Int {
6461
return stack
65-
.peek()
62+
.last()
6663
.first
6764
}
6865

6966
fun getMin(): Int {
7067
return stack
71-
.peek()
68+
.last()
7269
.second
7370
}
7471
}

src/main/kotlin/g0501_0600/s0552_student_attendance_record_ii/readme.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ Given an integer `n`, return _the **number** of possible attendance records of l
4545
## Solution
4646

4747
```kotlin
48-
import java.util.Arrays
49-
5048
@Suppress("NAME_SHADOWING")
5149
class Solution {
5250
fun checkRecord(n: Int): Int {
@@ -64,7 +62,7 @@ class Solution {
6462
)
6563
val e = quickPower(matrix, n - 1)
6664
return (
67-
(Arrays.stream(e[0]).sum() + Arrays.stream(e[1]).sum() + Arrays.stream(e[3]).sum()) %
65+
(e[0].sum() + e[1].sum() + e[3].sum()) %
6866
mod
6967
).toInt()
7068
}

src/main/kotlin/g0601_0700/s0679_24_game/readme.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ Return `true` if you can get such expression that evaluates to `24`, and `false`
4040
## Solution
4141

4242
```kotlin
43-
import java.util.Arrays
4443
import kotlin.math.abs
4544

4645
class Solution {
47-
private fun backtrack(list: DoubleArray, n: Int): Boolean {
46+
private fun backtrack(list: Array<Double>, n: Int): Boolean {
4847
if (n == 1) {
4948
return abs(list[0] - 24) < EPS
5049
}
@@ -89,7 +88,7 @@ class Solution {
8988
}
9089

9190
fun judgePoint24(nums: IntArray): Boolean {
92-
val a = Arrays.stream(nums).asDoubleStream().toArray()
91+
val a = nums.map { it.toDouble() }.toTypedArray()
9392
return backtrack(a, a.size)
9493
}
9594

src/main/kotlin/g0701_0800/s0770_basic_calculator_iv/readme.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ The format of the output is as follows:
6262

6363
```kotlin
6464
import java.util.Collections
65-
import java.util.Stack
6665

6766
class Solution {
6867
internal inner class Node {
@@ -184,10 +183,10 @@ class Solution {
184183
return 0
185184
}
186185

187-
private fun helper(numS: Stack<Node>, ops: Stack<Char>): Node {
188-
val b = numS.pop()
189-
val a = numS.pop()
190-
val op = ops.pop()
186+
private fun helper(numS: ArrayDeque<Node>, ops: ArrayDeque<Char>): Node {
187+
val b = numS.removeLast()
188+
val a = numS.removeLast()
189+
val op = ops.removeLast()
191190
if (op == '*') {
192191
return a.mul(b)
193192
} else if (op == '+') {
@@ -206,8 +205,8 @@ class Solution {
206205
vars[evalvarS[i]] = evalintS[i]
207206
}
208207
val n = expression.length
209-
val numS = Stack<Node>()
210-
val ops = Stack<Char>()
208+
val numS = ArrayDeque<Node>()
209+
val ops = ArrayDeque<Char>()
211210
var i = 0
212211
while (i < n) {
213212
val a = expression[i]
@@ -220,12 +219,12 @@ class Solution {
220219
} else if (a == '(') {
221220
ops.add(a)
222221
} else if (a == ')') {
223-
while (ops.peek() != '(') {
222+
while (ops.last() != '(') {
224223
numS.add(helper(numS, ops))
225224
}
226-
ops.pop()
225+
ops.removeLast()
227226
} else if (a == '+' || a == '-' || a == '*') {
228-
while (ops.isNotEmpty() && getPriority(ops.peek()) >= getPriority(a)) {
227+
while (ops.isNotEmpty() && getPriority(ops.last()) >= getPriority(a)) {
229228
numS.add(helper(numS, ops))
230229
}
231230
ops.add(a)
@@ -235,7 +234,7 @@ class Solution {
235234
while (ops.isNotEmpty()) {
236235
numS.add(helper(numS, ops))
237236
}
238-
return numS.peek().evaluate(vars).toList()
237+
return numS.last().evaluate(vars).toList()
239238
}
240239
}
241240
```

src/main/kotlin/g0901_1000/s0954_array_of_doubled_pairs/readme.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ Given an integer array of even length `arr`, return `true` _if it is possible to
3636
## Solution
3737

3838
```kotlin
39-
import java.util.Arrays
40-
4139
class Solution {
4240
fun canReorderDoubled(arr: IntArray): Boolean {
43-
val max = 0.coerceAtLeast(Arrays.stream(arr).max().asInt)
44-
val min = 0.coerceAtMost(Arrays.stream(arr).min().asInt)
41+
val max = 0.coerceAtLeast(arr.max())
42+
val min = 0.coerceAtMost(arr.min())
4543
val positive = IntArray(max + 1)
4644
val negative = IntArray(-min + 1)
4745
for (a in arr) {

src/main/kotlin/g1001_1100/s1005_maximize_sum_of_array_after_k_negations/readme.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ Return _the largest possible sum of the array after modifying it in this way_.
4646
## Solution
4747

4848
```kotlin
49-
import java.util.Arrays
50-
5149
@Suppress("NAME_SHADOWING")
5250
class Solution {
5351
fun largestSumAfterKNegations(nums: IntArray, k: Int): Int {
@@ -68,7 +66,7 @@ class Solution {
6866
if (k and 1 == 1) {
6967
nums[minIndex] *= -1
7068
}
71-
return Arrays.stream(nums).sum()
69+
return nums.sum()
7270
}
7371
}
7472
```

0 commit comments

Comments
 (0)