DatasetRepo commited on
Commit
2508fb2
·
verified ·
1 Parent(s): 38d8207

03ab2ccbb3c596f4b569ea29a1708c2f35c9615f61d50e8706d35be5ad7589e2

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +3 -0
  2. k_th_nearest_obstacle_queries/java_tests/Main.java +21 -0
  3. k_th_nearest_obstacle_queries/meta.json +3 -0
  4. k_th_nearest_obstacle_queries/ocaml_tests/main.ml +0 -0
  5. k_th_nearest_obstacle_queries/scala_tests/MySuite.scala +0 -0
  6. keep_multiplying_found_values_by_two/.DS_Store +0 -0
  7. keep_multiplying_found_values_by_two/haskell_tests/Main.hs +24 -0
  8. keep_multiplying_found_values_by_two/java_tests/Main.java +21 -0
  9. keep_multiplying_found_values_by_two/meta.json +0 -0
  10. keep_multiplying_found_values_by_two/ocaml_tests/main.ml +26 -0
  11. keep_multiplying_found_values_by_two/scala_tests/MySuite.scala +12 -0
  12. kth_smallest_amount_with_single_denomination_combination/haskell_tests/Main.hs +45 -0
  13. kth_smallest_amount_with_single_denomination_combination/java_tests/Main.java +21 -0
  14. kth_smallest_amount_with_single_denomination_combination/meta.json +187 -0
  15. kth_smallest_amount_with_single_denomination_combination/ocaml_tests/main.ml +50 -0
  16. kth_smallest_amount_with_single_denomination_combination/scala_tests/MySuite.scala +44 -0
  17. largest_3_same_digit_number_in_string/.DS_Store +0 -0
  18. largest_3_same_digit_number_in_string/haskell_tests/Main.hs +27 -0
  19. largest_3_same_digit_number_in_string/java_tests/Main.java +25 -0
  20. largest_3_same_digit_number_in_string/meta.json +72 -0
  21. largest_3_same_digit_number_in_string/ocaml_tests/main.ml +29 -0
  22. largest_3_same_digit_number_in_string/scala_tests/MySuite.scala +16 -0
  23. largest_combination_with_bitwise_and_greater_than_zero/.DS_Store +0 -0
  24. largest_combination_with_bitwise_and_greater_than_zero/haskell_tests/Main.hs +24 -0
  25. largest_combination_with_bitwise_and_greater_than_zero/java_tests/Main.java +21 -0
  26. largest_combination_with_bitwise_and_greater_than_zero/meta.json +3 -0
  27. largest_combination_with_bitwise_and_greater_than_zero/ocaml_tests/main.ml +26 -0
  28. largest_combination_with_bitwise_and_greater_than_zero/scala_tests/MySuite.scala +12 -0
  29. largest_element_in_an_array_after_merge_operations/.DS_Store +0 -0
  30. largest_element_in_an_array_after_merge_operations/haskell_tests/Main.hs +24 -0
  31. largest_element_in_an_array_after_merge_operations/java_tests/Main.java +21 -0
  32. largest_element_in_an_array_after_merge_operations/meta.json +3 -0
  33. largest_element_in_an_array_after_merge_operations/ocaml_tests/main.ml +26 -0
  34. largest_element_in_an_array_after_merge_operations/scala_tests/MySuite.scala +12 -0
  35. largest_local_values_in_a_matrix/.DS_Store +0 -0
  36. largest_local_values_in_a_matrix/haskell_tests/Main.hs +24 -0
  37. largest_local_values_in_a_matrix/java_tests/Main.java +21 -0
  38. largest_local_values_in_a_matrix/meta.json +0 -0
  39. largest_local_values_in_a_matrix/ocaml_tests/main.ml +26 -0
  40. largest_local_values_in_a_matrix/scala_tests/MySuite.scala +12 -0
  41. largest_palindromic_number/.DS_Store +0 -0
  42. largest_palindromic_number/haskell_tests/Main.hs +24 -0
  43. largest_palindromic_number/java_tests/Main.java +21 -0
  44. largest_palindromic_number/meta.json +67 -0
  45. largest_palindromic_number/ocaml_tests/main.ml +26 -0
  46. largest_palindromic_number/scala_tests/MySuite.scala +12 -0
  47. largest_positive_integer_that_exists_with_its_negative/.DS_Store +0 -0
  48. largest_positive_integer_that_exists_with_its_negative/haskell_tests/Main.hs +27 -0
  49. largest_positive_integer_that_exists_with_its_negative/java_tests/Main.java +25 -0
  50. largest_positive_integer_that_exists_with_its_negative/meta.json +2758 -0
.gitattributes CHANGED
@@ -139,3 +139,6 @@ house_robber_iv/meta.json filter=lfs diff=lfs merge=lfs -text
139
  increment_submatrices_by_one/meta.json filter=lfs diff=lfs merge=lfs -text
140
  intervals_between_identical_elements/meta.json filter=lfs diff=lfs merge=lfs -text
141
  k_th_nearest_obstacle_queries/haskell_tests/Main.hs filter=lfs diff=lfs merge=lfs -text
 
 
 
 
139
  increment_submatrices_by_one/meta.json filter=lfs diff=lfs merge=lfs -text
140
  intervals_between_identical_elements/meta.json filter=lfs diff=lfs merge=lfs -text
141
  k_th_nearest_obstacle_queries/haskell_tests/Main.hs filter=lfs diff=lfs merge=lfs -text
142
+ k_th_nearest_obstacle_queries/meta.json filter=lfs diff=lfs merge=lfs -text
143
+ largest_combination_with_bitwise_and_greater_than_zero/meta.json filter=lfs diff=lfs merge=lfs -text
144
+ largest_element_in_an_array_after_merge_operations/meta.json filter=lfs diff=lfs merge=lfs -text
k_th_nearest_obstacle_queries/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(new ArrayList<>(Arrays.asList(-1,7,5,3)), resultsArray(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,2)),new ArrayList<>(Arrays.asList(3,4)),new ArrayList<>(Arrays.asList(2,3)),new ArrayList<>(Arrays.asList(-3,0)))), 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(10,8,6)), resultsArray(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(5,5)),new ArrayList<>(Arrays.asList(4,4)),new ArrayList<>(Arrays.asList(3,3)))), 1));
19
+ }
20
+
21
+ }
k_th_nearest_obstacle_queries/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:422dd72288fae67c9e7b4276c59761432319db784ec24aaf79f7c1e8bb467e09
3
+ size 27808393
k_th_nearest_obstacle_queries/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
k_th_nearest_obstacle_queries/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
keep_multiplying_found_values_by_two/.DS_Store ADDED
Binary file (6.15 kB). View file
 
keep_multiplying_found_values_by_two/haskell_tests/Main.hs ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (findFinalValue [5,3,6,1,12] 3)," 24 (findFinalValue [5,3,6,1,12] 3))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (findFinalValue [2,7,9] 4)," 4 (findFinalValue [2,7,9] 4))
16
+
17
+
18
+ -- Grouping test cases
19
+ tests :: Test
20
+ tests = TestList [TestLabel "Test1" test1]
21
+
22
+ -- Running the tests
23
+ main :: IO Counts
24
+ main = runTestTT tests
keep_multiplying_found_values_by_two/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(24, findFinalValue(new ArrayList<>(Arrays.asList(5,3,6,1,12)), 3));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(4, findFinalValue(new ArrayList<>(Arrays.asList(2,7,9)), 4));
19
+ }
20
+
21
+ }
keep_multiplying_found_values_by_two/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
keep_multiplying_found_values_by_two/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 24 (findFinalValue [5;3;6;1;12] 3)
12
+
13
+ let test2 _ = assert_equal 4 (findFinalValue [2;7;9] 4)
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for findFinalValue" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
keep_multiplying_found_values_by_two/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.findFinalValue(List(5,3,6,1,12),3), 24)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.findFinalValue(List(2,7,9),4), 4)
10
+ }
11
+
12
+ }
kth_smallest_amount_with_single_denomination_combination/haskell_tests/Main.hs ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (findKthSmallest [3,6,9] 3)," 9 (findKthSmallest [3,6,9] 3))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (findKthSmallest [5,2] 7)," 12 (findKthSmallest [5,2] 7))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (findKthSmallest [22, 19, 23, 7, 21, 4, 18] 179515623)," 394779506 (findKthSmallest [22, 19, 23, 7, 21, 4, 18] 179515623))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (findKthSmallest [4, 13, 25, 21, 2, 19, 5, 22, 6, 10, 3, 9, 7, 23, 18] 456523631)," 564441242 (findKthSmallest [4, 13, 25, 21, 2, 19, 5, 22, 6, 10, 3, 9, 7, 23, 18] 456523631))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (findKthSmallest [21, 18, 11, 24, 2, 13, 15, 8, 12, 3, 19] 60303763)," 82045731 (findKthSmallest [21, 18, 11, 24, 2, 13, 15, 8, 12, 3, 19] 60303763))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (findKthSmallest [24, 4, 12, 19, 21, 18, 17, 11, 5, 20, 9, 15, 23, 14, 22] 1736682371)," 2819188176 (findKthSmallest [24, 4, 12, 19, 21, 18, 17, 11, 5, 20, 9, 15, 23, 14, 22] 1736682371))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (findKthSmallest [9, 12, 7, 23, 8] 992400036)," 2577038805 (findKthSmallest [9, 12, 7, 23, 8] 992400036))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (findKthSmallest [21] 1900534776)," 39911230296 (findKthSmallest [21] 1900534776))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (findKthSmallest [14, 4, 11, 20, 17, 3, 8, 13, 2] 1300066508)," 1764635218 (findKthSmallest [14, 4, 11, 20, 17, 3, 8, 13, 2] 1300066508))
37
+
38
+
39
+ -- Grouping test cases
40
+ tests :: Test
41
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6, TestLabel "Test7" test7, TestLabel "Test8" test8, TestLabel "Test9" test9]
42
+
43
+ -- Running the tests
44
+ main :: IO Counts
45
+ main = runTestTT tests
kth_smallest_amount_with_single_denomination_combination/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(9, findKthSmallest(new ArrayList<>(Arrays.asList(3,6,9)), 3));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(12, findKthSmallest(new ArrayList<>(Arrays.asList(5,2)), 7));
19
+ }
20
+
21
+ }
kth_smallest_amount_with_single_denomination_combination/meta.json ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3375,
3
+ "name": "kth_smallest_amount_with_single_denomination_combination",
4
+ "difficulty": "Hard",
5
+ "link": "https://leetcode.com/problems/kth-smallest-amount-with-single-denomination-combination/",
6
+ "date": "2024-04-07 00:00:00",
7
+ "task_description": "You are given an integer array `coins` representing coins of different denominations and an integer `k`. You have an infinite number of coins of each denomination. However, you are **not allowed** to combine coins of different denominations. Return the `kth` **smallest** amount that can be made using these coins. **Example 1:** **Input:** coins = [3,6,9], k = 3 **Output:** 9 **Explanation:** The given coins can make the following amounts: Coin 3 produces multiples of 3: 3, 6, 9, 12, 15, etc. Coin 6 produces multiples of 6: 6, 12, 18, 24, etc. Coin 9 produces multiples of 9: 9, 18, 27, 36, etc. All of the coins combined produce: 3, 6, **9**, 12, 15, etc. **Example 2:** **Input:** coins = [5,2], k = 7 **Output:** 12 **Explanation:** The given coins can make the following amounts: Coin 5 produces multiples of 5: 5, 10, 15, 20, etc. Coin 2 produces multiples of 2: 2, 4, 6, 8, 10, 12, etc. All of the coins combined produce: 2, 4, 5, 6, 8, 10, **12**, 14, 15, etc. **Constraints:** `1 <= coins.length <= 15` `1 <= coins[i] <= 25` `1 <= k <= 2 * 109` `coins` contains pairwise distinct integers.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "coins = [3,6,9], k = 3",
12
+ "output": "9 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "coins = [5,2], k = 7",
17
+ "output": "12 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ [
24
+ 22,
25
+ 19,
26
+ 23,
27
+ 7,
28
+ 21,
29
+ 4,
30
+ 18
31
+ ],
32
+ 179515623
33
+ ],
34
+ "output": 394779506
35
+ },
36
+ {
37
+ "input": [
38
+ [
39
+ 4,
40
+ 13,
41
+ 25,
42
+ 21,
43
+ 2,
44
+ 19,
45
+ 5,
46
+ 22,
47
+ 6,
48
+ 10,
49
+ 3,
50
+ 9,
51
+ 7,
52
+ 23,
53
+ 18
54
+ ],
55
+ 456523631
56
+ ],
57
+ "output": 564441242
58
+ },
59
+ {
60
+ "input": [
61
+ [
62
+ 21,
63
+ 18,
64
+ 11,
65
+ 24,
66
+ 2,
67
+ 13,
68
+ 15,
69
+ 8,
70
+ 12,
71
+ 3,
72
+ 19
73
+ ],
74
+ 60303763
75
+ ],
76
+ "output": 82045731
77
+ },
78
+ {
79
+ "input": [
80
+ [
81
+ 24,
82
+ 4,
83
+ 12,
84
+ 19,
85
+ 21,
86
+ 18,
87
+ 17,
88
+ 11,
89
+ 5,
90
+ 20,
91
+ 9,
92
+ 15,
93
+ 23,
94
+ 14,
95
+ 22
96
+ ],
97
+ 1736682371
98
+ ],
99
+ "output": 2819188176
100
+ },
101
+ {
102
+ "input": [
103
+ [
104
+ 9,
105
+ 12,
106
+ 7,
107
+ 23,
108
+ 8
109
+ ],
110
+ 992400036
111
+ ],
112
+ "output": 2577038805
113
+ },
114
+ {
115
+ "input": [
116
+ [
117
+ 21
118
+ ],
119
+ 1900534776
120
+ ],
121
+ "output": 39911230296
122
+ },
123
+ {
124
+ "input": [
125
+ [
126
+ 14,
127
+ 4,
128
+ 11,
129
+ 20,
130
+ 17,
131
+ 3,
132
+ 8,
133
+ 13,
134
+ 2
135
+ ],
136
+ 1300066508
137
+ ],
138
+ "output": 1764635218
139
+ },
140
+ {
141
+ "input": [
142
+ [
143
+ 3,
144
+ 14,
145
+ 15,
146
+ 23,
147
+ 4,
148
+ 10,
149
+ 17,
150
+ 7,
151
+ 24
152
+ ],
153
+ 493157103
154
+ ],
155
+ "output": 770681166
156
+ },
157
+ {
158
+ "input": [
159
+ [
160
+ 5,
161
+ 8,
162
+ 15,
163
+ 10,
164
+ 25,
165
+ 22,
166
+ 12
167
+ ],
168
+ 99895996
169
+ ],
170
+ "output": 279370155
171
+ },
172
+ {
173
+ "input": [
174
+ [
175
+ 5
176
+ ],
177
+ 180705975
178
+ ],
179
+ "output": 903529875
180
+ }
181
+ ],
182
+ "haskell_template": "findKthSmallest :: [Int] -> Int -> Int\nfindKthSmallest coins k ",
183
+ "ocaml_template": "let findKthSmallest (coins: int list) (k: int) : int = ",
184
+ "scala_template": "def findKthSmallest(coins: List[Int],k: Int): Int = { \n \n}",
185
+ "java_template": "class Solution {\n public long findKthSmallest(int[] coins, int k) {\n \n }\n}",
186
+ "python_template": "class Solution(object):\n def findKthSmallest(self, coins, k):\n \"\"\"\n :type coins: List[int]\n :type k: int\n :rtype: int\n \"\"\"\n "
187
+ }
kth_smallest_amount_with_single_denomination_combination/ocaml_tests/main.ml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 9 (findKthSmallest [3;6;9] 3)
12
+
13
+ let test2 _ = assert_equal 12 (findKthSmallest [5;2] 7)
14
+
15
+ let test3 _ = assert_equal 394779506 (findKthSmallest [22; 19; 23; 7; 21; 4; 18] 179515623)
16
+
17
+ let test4 _ = assert_equal 564441242 (findKthSmallest [4; 13; 25; 21; 2; 19; 5; 22; 6; 10; 3; 9; 7; 23; 18] 456523631)
18
+
19
+ let test5 _ = assert_equal 82045731 (findKthSmallest [21; 18; 11; 24; 2; 13; 15; 8; 12; 3; 19] 60303763)
20
+
21
+ let test6 _ = assert_equal 2819188176 (findKthSmallest [24; 4; 12; 19; 21; 18; 17; 11; 5; 20; 9; 15; 23; 14; 22] 1736682371)
22
+
23
+ let test7 _ = assert_equal 2577038805 (findKthSmallest [9; 12; 7; 23; 8] 992400036)
24
+
25
+ let test8 _ = assert_equal 39911230296 (findKthSmallest [21] 1900534776)
26
+
27
+ let test9 _ = assert_equal 1764635218 (findKthSmallest [14; 4; 11; 20; 17; 3; 8; 13; 2] 1300066508)
28
+
29
+ let test10 _ = assert_equal 770681166 (findKthSmallest [3; 14; 15; 23; 4; 10; 17; 7; 24] 493157103)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for findKthSmallest" >::: [
34
+
35
+ "test1" >:: test1;
36
+ "test2" >:: test2;
37
+ "test3" >:: test3;
38
+ "test4" >:: test4;
39
+ "test5" >:: test5;
40
+ "test6" >:: test6;
41
+ "test7" >:: test7;
42
+ "test8" >:: test8;
43
+ "test9" >:: test9;
44
+ "test10" >:: test10;
45
+ ]
46
+
47
+
48
+ (* Running the tests *)
49
+ let () = run_test_tt_main suite
50
+ end
kth_smallest_amount_with_single_denomination_combination/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.findKthSmallest(List(3,6,9),3), 9)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.findKthSmallest(List(5,2),7), 12)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.findKthSmallest(List(22, 19, 23, 7, 21, 4, 18),179515623), 394779506)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.findKthSmallest(List(4, 13, 25, 21, 2, 19, 5, 22, 6, 10, 3, 9, 7, 23, 18),456523631), 564441242)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.findKthSmallest(List(21, 18, 11, 24, 2, 13, 15, 8, 12, 3, 19),60303763), 82045731)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.findKthSmallest(List(24, 4, 12, 19, 21, 18, 17, 11, 5, 20, 9, 15, 23, 14, 22),1736682371), BigInt("2819188176"))
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.findKthSmallest(List(9, 12, 7, 23, 8),992400036), BigInt("2577038805"))
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.findKthSmallest(List(21),1900534776), BigInt("39911230296"))
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.findKthSmallest(List(14, 4, 11, 20, 17, 3, 8, 13, 2),1300066508), 1764635218)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.findKthSmallest(List(3, 14, 15, 23, 4, 10, 17, 7, 24),493157103), 770681166)
42
+ }
43
+
44
+ }
largest_3_same_digit_number_in_string/.DS_Store ADDED
Binary file (6.15 kB). View file
 
largest_3_same_digit_number_in_string/haskell_tests/Main.hs ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (largestGoodInteger \"6 777 133339 \")," "777" (largestGoodInteger "6 777 133339"))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (largestGoodInteger \"23 000 19 \")," "000" (largestGoodInteger "23 000 19"))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (largestGoodInteger \"42352338 \")," "" (largestGoodInteger "42352338"))
19
+
20
+
21
+ -- Grouping test cases
22
+ tests :: Test
23
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2]
24
+
25
+ -- Running the tests
26
+ main :: IO Counts
27
+ main = runTestTT tests
largest_3_same_digit_number_in_string/java_tests/Main.java ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals("6 777 133339", largestGoodInteger("6 777 133339"));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("23 000 19", largestGoodInteger("23 000 19"));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals("42352338", largestGoodInteger("42352338"));
23
+ }
24
+
25
+ }
largest_3_same_digit_number_in_string/meta.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2346,
3
+ "name": "largest_3_same_digit_number_in_string",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/largest-3-same-digit-number-in-string/",
6
+ "date": "1651363200000",
7
+ "task_description": "You are given a string `num` representing a large integer. An integer is **good** if it meets the following conditions: It is a **substring** of `num` with length `3`. It consists of only one unique digit. Return _the **maximum good **integer as a **string** or an empty string _`\"\"`_ if no such integer exists_. Note: A **substring** is a contiguous sequence of characters within a string. There may be **leading zeroes** in `num` or a good integer. **Example 1:** ``` **Input:** num = \"6**777**133339\" **Output:** \"777\" **Explanation:** There are two distinct good integers: \"777\" and \"333\". \"777\" is the largest, so we return \"777\". ``` **Example 2:** ``` **Input:** num = \"23**000**19\" **Output:** \"000\" **Explanation:** \"000\" is the only good integer. ``` **Example 3:** ``` **Input:** num = \"42352338\" **Output:** \"\" **Explanation:** No substring of length 3 consists of only one unique digit. Therefore, there are no good integers. ``` **Constraints:** `3 <= num.length <= 1000` `num` only consists of digits.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "num = \"6 777 133339\"",
12
+ "output": "\"777\" "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "num = \"23 000 19\"",
17
+ "output": "\"000\" "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "num = \"42352338\"",
22
+ "output": "\"\" "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": "10848558887451529562399824892249063295573302687714867726247825433478151593337015096112051310847176327315141750783505626390086820407142390143245980885287222547268009922288777421999646781790623902395690852955261930974507683651781052764181531519406441588049860448279820190326072303401308854006875409945113367931462657349059435994309403688692483386511557263512248119174669415680021146134368168641485458863809062016363211760308798332797013996524554539119951980156840185313585280974915529699426546397375719595837896905261529054565778111577698713553780623651880170767949347530394813704341638",
28
+ "output": "999"
29
+ },
30
+ {
31
+ "input": "47426887255841422940727384852730590925752629600461180972805741763417704395379701210464218806703804072608752847941624061081658686280785200554805253619349685885942473902642709150888213438209447899894695762278301896326216623576645899005329681998611857335207020091684599884375447207140846748585060448073488871336378667426183006251333530352645026079207079820085188588225338629872770617352545578100593172982482968114648138595773007135325437308180554918312316885129706463065683580270278214127636296513925573704533193724048330356471280986019273010628214900294417125830680531377939952202615423688744012249155193863324220542775405412695545033719536175067598",
32
+ "output": "888"
33
+ },
34
+ {
35
+ "input": "738048384163579046383583833585912061948169810763177715912952198244475182441915240510976498436468260847762946176312085113761419723199738383317650905495713028734366898353750356501857264217487816791462260304703996646548589984109946029889087074038837401879926731522053424082740552484458556141012986908489664361034712674798183682358121322422727327775867082605111873434076280759183034541099684312367252818106017173713189962367426025799925273962404207651562189536961238750014240495266902618014127358110",
36
+ "output": "999"
37
+ },
38
+ {
39
+ "input": "20209784743196939784503944352089875700757627790781375962866866897339998345279606032590560921191153900901217428584457899591916460620332246009942800379661594647183473452387479278",
40
+ "output": "999"
41
+ },
42
+ {
43
+ "input": "5548411556853590416728324497574743015738062966157881918587275799498324254891201497937916087812096852463024601053540406806014368947907700213158922587772111582606976647591232449570189253693801976582802678787871592640766663151224166469861611051645946723863666620586842480784895086975849009496917114341012115611574410200760492269029887282845090751641664131834193490342560824893101621115484103030906658884933319211841797040599649151593415819890038165746674486932597067412598642726350922112753967970479449354460410399642921789698638403523272017435958293407514573868403682632134909546250734669056158526269736151210092915267407485144474174648124028098994591181856301661714408984341484382249893726323167469163608227536254186333361296577399543594732138365012586708407952133229323240176647215489372222648254470081490670569912768094801133377396885230518233709570493860745619332564152012171202667306890633847",
44
+ "output": "888"
45
+ },
46
+ {
47
+ "input": "558525214095448955075293446516741317848899534263253659714969548538738896733587016157594097166156961465068886993616599233235575574253106995756424997751023279574655895299604787669434430530006232982727869806217550043060031283000485437785611173056520932958592543020874993056623503627914716866740549037015273784660398273336309731368846714406153875804705165867472496302049541597901054592319961085200123720743229473369900345481168420681958520154188010844049730046362087710601569818455449533216053633240277062901686347717518799557090381335773315864913595606650763016396816130021049818084514266021140810691169199426856648221714310905439742373487964511096693923320932883427943953528346180391862832239992394318766928921213132255018702404961490512070768896288605312098100187510316946786850302260956581916503053769258372468287640849019088767045065299883312331560866766978438026276010235268705298714763336461678270700044688044003565498076558337307885125128995792440009567308781585222016993605548158659339",
48
+ "output": "999"
49
+ },
50
+ {
51
+ "input": "7029428553518057506087288381487004528774546027105731217319980930568153760239755254772763611258652044522879026884683174253528954935951924484478059289938763129895022785439420687113132718393277231777614081060012540902746326704193450214686259678250262851492006776095673921170023997649457212121734252152627660806578130862885626190793550563162744431620498857462015960496611632",
52
+ "output": "777"
53
+ },
54
+ {
55
+ "input": "4902847507944205784467343917307446625649954161420242735051679920785132253773660918691653055989260793055207678807054119888813957105913335159277604331712018553437799924689478182041481071606774575296428378536353903946866248258335665780194100675057743725989345525729226449619032570030072293099228681280030896534120669216535295233011330709920943739779679238568815078735099645380852756656994093598712184309843557743341128799774197778332014399991434246439692465833415668027964663378426500733234336131086158741292124106803012897761155320813977887077054757282048240592974899562094707461088031625946412261991141201914584379238169650853034705104313004191342093594533966262243356985107328289571005772800507513647042060399148943317657784840471533287314680052360139786671772862796245336631159214389698775846585291187816582504783139767628347596575393589169856443961988168385579030247114186306753223282344943495738596849347457715787371991483550275393599644744460745184919328185476626",
56
+ "output": "999"
57
+ },
58
+ {
59
+ "input": "4365758523152195793307564181162714472668301306525818573644014370240915474969378280181940401695283",
60
+ "output": ""
61
+ },
62
+ {
63
+ "input": "56751877305078539977603477691615457057182065594309404668558405080994224124818937407320253425653684924596773282542500377439669321234068503948396228776002741129116604083751237347680099661746407568875925195",
64
+ "output": ""
65
+ }
66
+ ],
67
+ "haskell_template": "largestGoodInteger :: String -> String\nlargestGoodInteger num ",
68
+ "ocaml_template": "let largestGoodInteger (num: string) : string = ",
69
+ "scala_template": "def largestGoodInteger(num: String): String = { \n \n}",
70
+ "java_template": "public static String largestGoodInteger(String num) {\n\n}",
71
+ "python_template": "class Solution(object):\n def largestGoodInteger(self, num):\n \"\"\"\n :type num: str\n :rtype: str\n \"\"\"\n "
72
+ }
largest_3_same_digit_number_in_string/ocaml_tests/main.ml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal "777" (largestGoodInteger "6 777 133339")
12
+
13
+ let test2 _ = assert_equal "000" (largestGoodInteger "23 000 19")
14
+
15
+ let test3 _ = assert_equal "" (largestGoodInteger "42352338")
16
+
17
+
18
+ (* Grouping test cases *)
19
+ let suite = "Test Suite for largestGoodInteger" >::: [
20
+
21
+ "test1" >:: test1;
22
+ "test2" >:: test2;
23
+ "test3" >:: test3;
24
+ ]
25
+
26
+
27
+ (* Running the tests *)
28
+ let () = run_test_tt_main suite
29
+ end
largest_3_same_digit_number_in_string/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.largestGoodInteger("6 777 133339"), "777")
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.largestGoodInteger("23 000 19"), "000")
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.largestGoodInteger("42352338"), "")
14
+ }
15
+
16
+ }
largest_combination_with_bitwise_and_greater_than_zero/.DS_Store ADDED
Binary file (6.15 kB). View file
 
largest_combination_with_bitwise_and_greater_than_zero/haskell_tests/Main.hs ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (largestCombination [16,17,71,62,12,24,14])," 4 (largestCombination [16,17,71,62,12,24,14]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (largestCombination [8,8])," 2 (largestCombination [8,8]))
16
+
17
+
18
+ -- Grouping test cases
19
+ tests :: Test
20
+ tests = TestList [TestLabel "Test1" test1]
21
+
22
+ -- Running the tests
23
+ main :: IO Counts
24
+ main = runTestTT tests
largest_combination_with_bitwise_and_greater_than_zero/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(4, largestCombination(new ArrayList<>(Arrays.asList(16,17,71,62,12,24,14))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(2, largestCombination(new ArrayList<>(Arrays.asList(8,8))));
19
+ }
20
+
21
+ }
largest_combination_with_bitwise_and_greater_than_zero/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a47424c4e558ee0cfe7ac2e1597a85243d9a290566c36d9e69c82cd57b964c34
3
+ size 13314049
largest_combination_with_bitwise_and_greater_than_zero/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 4 (largestCombination [16;17;71;62;12;24;14])
12
+
13
+ let test2 _ = assert_equal 2 (largestCombination [8;8])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for largestCombination" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
largest_combination_with_bitwise_and_greater_than_zero/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.largestCombination(List(16,17,71,62,12,24,14)), 4)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.largestCombination(List(8,8)), 2)
10
+ }
11
+
12
+ }
largest_element_in_an_array_after_merge_operations/.DS_Store ADDED
Binary file (6.15 kB). View file
 
largest_element_in_an_array_after_merge_operations/haskell_tests/Main.hs ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (maxArrayValue [2,3,7,9,3])," 21 (maxArrayValue [2,3,7,9,3]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (maxArrayValue [5,3,3])," 11 (maxArrayValue [5,3,3]))
16
+
17
+
18
+ -- Grouping test cases
19
+ tests :: Test
20
+ tests = TestList [TestLabel "Test1" test1]
21
+
22
+ -- Running the tests
23
+ main :: IO Counts
24
+ main = runTestTT tests
largest_element_in_an_array_after_merge_operations/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(21, maxArrayValue(new ArrayList<>(Arrays.asList(2,3,7,9,3))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(11, maxArrayValue(new ArrayList<>(Arrays.asList(5,3,3))));
19
+ }
20
+
21
+ }
largest_element_in_an_array_after_merge_operations/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a757cb94940e419204880ce987b8afb53d1637ebc9cc808bba6a7493551e405d
3
+ size 12382820
largest_element_in_an_array_after_merge_operations/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 21 (maxArrayValue [2;3;7;9;3])
12
+
13
+ let test2 _ = assert_equal 11 (maxArrayValue [5;3;3])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for maxArrayValue" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
largest_element_in_an_array_after_merge_operations/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.maxArrayValue(List(2,3,7,9,3)), 21)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.maxArrayValue(List(5,3,3)), 11)
10
+ }
11
+
12
+ }
largest_local_values_in_a_matrix/.DS_Store ADDED
Binary file (6.15 kB). View file
 
largest_local_values_in_a_matrix/haskell_tests/Main.hs ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (largestLocal [[9,9,8,1],[5,6,2,6],[8,2,6,4],[6,2,2,2]])," [[9,9],[8,6]] (largestLocal [[9,9,8,1],[5,6,2,6],[8,2,6,4],[6,2,2,2]]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (largestLocal [[1,1,1,1,1],[1,1,1,1,1],[1,1,2,1,1],[1,1,1,1,1],[1,1,1,1,1]])," [[2,2,2],[2,2,2],[2,2,2]] (largestLocal [[1,1,1,1,1],[1,1,1,1,1],[1,1,2,1,1],[1,1,1,1,1],[1,1,1,1,1]]))
16
+
17
+
18
+ -- Grouping test cases
19
+ tests :: Test
20
+ tests = TestList [TestLabel "Test1" test1]
21
+
22
+ -- Running the tests
23
+ main :: IO Counts
24
+ main = runTestTT tests
largest_local_values_in_a_matrix/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(9,9)),new ArrayList<>(Arrays.asList(8,6)))), largestLocal(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(9,9,8,1)),new ArrayList<>(Arrays.asList(5,6,2,6)),new ArrayList<>(Arrays.asList(8,2,6,4)),new ArrayList<>(Arrays.asList(6,2,2,2))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(2,2,2)),new ArrayList<>(Arrays.asList(2,2,2)),new ArrayList<>(Arrays.asList(2,2,2)))), largestLocal(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,1,1,1,1)),new ArrayList<>(Arrays.asList(1,1,1,1,1)),new ArrayList<>(Arrays.asList(1,1,2,1,1)),new ArrayList<>(Arrays.asList(1,1,1,1,1)),new ArrayList<>(Arrays.asList(1,1,1,1,1))))));
19
+ }
20
+
21
+ }
largest_local_values_in_a_matrix/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
largest_local_values_in_a_matrix/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal [[9;9];[8;6]] (largestLocal [[9;9;8;1];[5;6;2;6];[8;2;6;4];[6;2;2;2]])
12
+
13
+ let test2 _ = assert_equal [[2;2;2];[2;2;2];[2;2;2]] (largestLocal [[1;1;1;1;1];[1;1;1;1;1];[1;1;2;1;1];[1;1;1;1;1];[1;1;1;1;1]])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for largestLocal" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
largest_local_values_in_a_matrix/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.largestLocal(List(List(9,9,8,1),List(5,6,2,6),List(8,2,6,4),List(6,2,2,2))), List(List(9,9),List(8,6)))
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.largestLocal(List(List(1,1,1,1,1),List(1,1,1,1,1),List(1,1,2,1,1),List(1,1,1,1,1),List(1,1,1,1,1))), List(List(2,2,2),List(2,2,2),List(2,2,2)))
10
+ }
11
+
12
+ }
largest_palindromic_number/.DS_Store ADDED
Binary file (6.15 kB). View file
 
largest_palindromic_number/haskell_tests/Main.hs ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (largestPalindromic \"444947137 \")," "7449447" (largestPalindromic "444947137"))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (largestPalindromic \"00009 \")," "9" (largestPalindromic "00009"))
16
+
17
+
18
+ -- Grouping test cases
19
+ tests :: Test
20
+ tests = TestList [TestLabel "Test1" test1]
21
+
22
+ -- Running the tests
23
+ main :: IO Counts
24
+ main = runTestTT tests
largest_palindromic_number/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals("444947137", largestPalindromic("444947137"));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("00009", largestPalindromic("00009"));
19
+ }
20
+
21
+ }
largest_palindromic_number/meta.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2475,
3
+ "name": "largest_palindromic_number",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/largest-palindromic-number/",
6
+ "date": "1660435200000",
7
+ "task_description": "You are given a string `num` consisting of digits only. Return _the **largest palindromic** integer (in the form of a string) that can be formed using digits taken from _`num`. It should not contain **leading zeroes**. **Notes:** You do **not** need to use all the digits of `num`, but you must use **at least** one digit. The digits can be reordered. **Example 1:** ``` **Input:** num = \"444947137\" **Output:** \"7449447\" **Explanation:** Use the digits \"4449477\" from \"**44494****7**13**7**\" to form the palindromic integer \"7449447\". It can be shown that \"7449447\" is the largest palindromic integer that can be formed. ``` **Example 2:** ``` **Input:** num = \"00009\" **Output:** \"9\" **Explanation:** It can be shown that \"9\" is the largest palindromic integer that can be formed. Note that the integer returned should not contain leading zeroes. ``` **Constraints:** `1 <= num.length <= 105` `num` consists of digits.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "num = \"444947137\"",
12
+ "output": "\"7449447\" "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "num = \"00009\"",
17
+ "output": "\"9\" "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": "4574357",
23
+ "output": "7543457"
24
+ },
25
+ {
26
+ "input": "323771360305980",
27
+ "output": "733090337"
28
+ },
29
+ {
30
+ "input": "915977436646661402578806504359626452933532890394320262788748102836284924152437266070747858033901879",
31
+ "output": "99998888877777666666555544444333332222221100000900000112222223333344444555566666677777888889999"
32
+ },
33
+ {
34
+ "input": "8288073188005753773764289343236297261209139278936329",
35
+ "output": "9998887776654333322221008001222233334566777888999"
36
+ },
37
+ {
38
+ "input": "76460896679381678729518210215426903546870637252450074473722681197470990848740583",
39
+ "output": "999888877777766665554444332222111000090000111222233444455566667777778888999"
40
+ },
41
+ {
42
+ "input": "640561031312180076174196658564620",
43
+ "output": "87666543211100900111234566678"
44
+ },
45
+ {
46
+ "input": "38286509445513",
47
+ "output": "854393458"
48
+ },
49
+ {
50
+ "input": "18796610610152728699956907327526994501042085030356183882245317618431649159",
51
+ "output": "999988877666655554433322211111000090000111112223334455556666778889999"
52
+ },
53
+ {
54
+ "input": "9249031911327257978608320605506328216552099502171897527492664374199557948938161464101809914867350",
55
+ "output": "99999998888777766665555544443332222211111100000700000111111222223334444555556666777788889999999"
56
+ },
57
+ {
58
+ "input": "958186096215117931164019189995544089530747635649857600585949137997186954099326185909122",
59
+ "output": "9999999998888777666655555444332211111100005000011111122334445555566667778888999999999"
60
+ }
61
+ ],
62
+ "haskell_template": "largestPalindromic :: String -> String\nlargestPalindromic num ",
63
+ "ocaml_template": "let largestPalindromic (num: string) : string = ",
64
+ "scala_template": "def largestPalindromic(num: String): String = { \n \n}",
65
+ "java_template": "public static String largestPalindromic(String num) {\n\n}",
66
+ "python_template": "class Solution(object):\n def largestPalindromic(self, num):\n \"\"\"\n :type num: str\n :rtype: str\n \"\"\"\n "
67
+ }
largest_palindromic_number/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal "7449447" (largestPalindromic "444947137")
12
+
13
+ let test2 _ = assert_equal "9" (largestPalindromic "00009")
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for largestPalindromic" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
largest_palindromic_number/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.largestPalindromic("444947137"), "7449447")
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.largestPalindromic("00009"), "9")
10
+ }
11
+
12
+ }
largest_positive_integer_that_exists_with_its_negative/.DS_Store ADDED
Binary file (6.15 kB). View file
 
largest_positive_integer_that_exists_with_its_negative/haskell_tests/Main.hs ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (findMaxK [-1,2,-3,3])," 3 (findMaxK [-1,2,-3,3]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (findMaxK [-1,10,6,7,-7,1])," 7 (findMaxK [-1,10,6,7,-7,1]))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (findMaxK [-10,8,6,7,-2,-3])," (-1) (findMaxK [-10,8,6,7,-2,-3]))
19
+
20
+
21
+ -- Grouping test cases
22
+ tests :: Test
23
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2]
24
+
25
+ -- Running the tests
26
+ main :: IO Counts
27
+ main = runTestTT tests
largest_positive_integer_that_exists_with_its_negative/java_tests/Main.java ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(3, findMaxK(new ArrayList<>(Arrays.asList(-1,2,-3,3))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(7, findMaxK(new ArrayList<>(Arrays.asList(-1,10,6,7,-7,1))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(-1, findMaxK(new ArrayList<>(Arrays.asList(-10,8,6,7,-2,-3))));
23
+ }
24
+
25
+ }
largest_positive_integer_that_exists_with_its_negative/meta.json ADDED
@@ -0,0 +1,2758 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2524,
3
+ "name": "largest_positive_integer_that_exists_with_its_negative",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/largest-positive-integer-that-exists-with-its-negative/",
6
+ "date": "1665273600000",
7
+ "task_description": "Given an integer array `nums` that **does not contain** any zeros, find **the largest positive** integer `k` such that `-k` also exists in the array. Return _the positive integer _`k`. If there is no such integer, return `-1`. **Example 1:** ``` **Input:** nums = [-1,2,-3,3] **Output:** 3 **Explanation:** 3 is the only valid k we can find in the array. ``` **Example 2:** ``` **Input:** nums = [-1,10,6,7,-7,1] **Output:** 7 **Explanation:** Both 1 and 7 have their corresponding negative values in the array. 7 has a larger value. ``` **Example 3:** ``` **Input:** nums = [-10,8,6,7,-2,-3] **Output:** -1 **Explanation:** There is no a single valid k, we return -1. ``` **Constraints:** `1 <= nums.length <= 1000` `-1000 <= nums[i] <= 1000` `nums[i] != 0`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "nums = [-1,2,-3,3]",
12
+ "output": "3 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "nums = [-1,10,6,7,-7,1]",
17
+ "output": "7 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "nums = [-10,8,6,7,-2,-3]",
22
+ "output": "-1 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ 514,
29
+ -503,
30
+ -498,
31
+ -492,
32
+ 21,
33
+ 535,
34
+ 538,
35
+ 27,
36
+ 540,
37
+ -995,
38
+ -483,
39
+ 544,
40
+ 33,
41
+ -990,
42
+ 41,
43
+ 47,
44
+ 559,
45
+ -976,
46
+ -974,
47
+ -460,
48
+ 566,
49
+ -450,
50
+ -442,
51
+ 584,
52
+ -439,
53
+ -428,
54
+ 599,
55
+ -935,
56
+ -422,
57
+ -931,
58
+ -417,
59
+ 97,
60
+ -920,
61
+ -403,
62
+ -914,
63
+ -398,
64
+ 115,
65
+ -395,
66
+ -907,
67
+ -393,
68
+ 123,
69
+ -899,
70
+ 641,
71
+ -894,
72
+ 136,
73
+ -888,
74
+ -886,
75
+ -884,
76
+ 656,
77
+ 657,
78
+ 658,
79
+ -368,
80
+ -878,
81
+ 149,
82
+ 662,
83
+ -365,
84
+ -876,
85
+ -875,
86
+ -362,
87
+ -871,
88
+ -868,
89
+ -867,
90
+ -865,
91
+ 161,
92
+ -862,
93
+ 167,
94
+ -343,
95
+ 170,
96
+ -341,
97
+ -852,
98
+ 174,
99
+ 688,
100
+ -847,
101
+ 178,
102
+ 691,
103
+ -841,
104
+ -837,
105
+ 700,
106
+ -324,
107
+ -832,
108
+ -318,
109
+ 711,
110
+ 200,
111
+ 199,
112
+ -312,
113
+ 719,
114
+ 211,
115
+ -301,
116
+ 213,
117
+ -299,
118
+ 728,
119
+ 733,
120
+ -290,
121
+ 223,
122
+ -288,
123
+ -796,
124
+ 741,
125
+ -794,
126
+ -790,
127
+ 747,
128
+ 750,
129
+ -266,
130
+ -774,
131
+ 763,
132
+ -258,
133
+ 258,
134
+ -763,
135
+ 774,
136
+ 266,
137
+ -750,
138
+ -747,
139
+ 790,
140
+ 794,
141
+ -741,
142
+ 796,
143
+ 288,
144
+ -223,
145
+ 290,
146
+ -733,
147
+ -728,
148
+ 299,
149
+ -213,
150
+ 301,
151
+ -211,
152
+ -719,
153
+ 312,
154
+ -200,
155
+ -711,
156
+ -199,
157
+ 318,
158
+ 832,
159
+ 324,
160
+ 837,
161
+ -700,
162
+ 841,
163
+ -691,
164
+ -178,
165
+ 847,
166
+ -688,
167
+ -174,
168
+ 852,
169
+ 341,
170
+ -170,
171
+ 343,
172
+ -167,
173
+ 862,
174
+ -161,
175
+ 865,
176
+ 867,
177
+ 868,
178
+ 871,
179
+ 362,
180
+ 875,
181
+ 876,
182
+ 365,
183
+ 878,
184
+ -662,
185
+ 368,
186
+ -149,
187
+ -658,
188
+ -657,
189
+ 884,
190
+ -656,
191
+ 886,
192
+ 888,
193
+ -136,
194
+ 894,
195
+ -641,
196
+ 899,
197
+ -123,
198
+ 393,
199
+ 395,
200
+ 907,
201
+ -115,
202
+ 398,
203
+ 914,
204
+ 403,
205
+ 920,
206
+ -97,
207
+ 417,
208
+ 931,
209
+ 422,
210
+ 935,
211
+ -599,
212
+ 428,
213
+ 439,
214
+ -584,
215
+ 442,
216
+ 450,
217
+ -566,
218
+ 460,
219
+ 974,
220
+ 976,
221
+ -47,
222
+ -559,
223
+ -41,
224
+ 990,
225
+ -33,
226
+ -544,
227
+ 995,
228
+ 483,
229
+ -540,
230
+ -27,
231
+ -538,
232
+ -535,
233
+ -21,
234
+ 492,
235
+ 498,
236
+ 503,
237
+ -514
238
+ ],
239
+ "output": 995
240
+ },
241
+ {
242
+ "input": [
243
+ 130,
244
+ 389,
245
+ -121,
246
+ 910,
247
+ 274,
248
+ -494,
249
+ 406,
250
+ 154,
251
+ -228,
252
+ 417,
253
+ 674,
254
+ -351,
255
+ -979,
256
+ 817,
257
+ -334,
258
+ -588,
259
+ -716,
260
+ -456,
261
+ 574,
262
+ -574,
263
+ 456,
264
+ 588,
265
+ 716,
266
+ 334,
267
+ -817,
268
+ 979,
269
+ -674,
270
+ 351,
271
+ -417,
272
+ 228,
273
+ -154,
274
+ -406,
275
+ 494,
276
+ -274,
277
+ -910,
278
+ 121,
279
+ -389,
280
+ -130
281
+ ],
282
+ "output": 979
283
+ },
284
+ {
285
+ "input": [
286
+ 5,
287
+ 8,
288
+ 9,
289
+ 10,
290
+ 11,
291
+ 15,
292
+ 21,
293
+ 24,
294
+ 26,
295
+ 29,
296
+ 30,
297
+ 32,
298
+ 34,
299
+ 38,
300
+ 44,
301
+ 47,
302
+ 50,
303
+ 52,
304
+ 60,
305
+ 64,
306
+ 67,
307
+ 69,
308
+ 74,
309
+ 75,
310
+ 78,
311
+ 80,
312
+ 82,
313
+ 84,
314
+ 88,
315
+ 89,
316
+ 103,
317
+ 106,
318
+ 107,
319
+ 108,
320
+ 109,
321
+ 114,
322
+ 118,
323
+ 121,
324
+ 122,
325
+ 125,
326
+ 126,
327
+ 127,
328
+ 132,
329
+ 133,
330
+ 140,
331
+ 142,
332
+ 147,
333
+ 149,
334
+ 151,
335
+ 152,
336
+ 161,
337
+ 166,
338
+ 169,
339
+ 176,
340
+ 184,
341
+ 191,
342
+ 192,
343
+ 195,
344
+ 196,
345
+ 204,
346
+ 206,
347
+ 211,
348
+ 213,
349
+ 214,
350
+ 218,
351
+ 219,
352
+ 220,
353
+ 223,
354
+ 227,
355
+ 229,
356
+ 231,
357
+ 233,
358
+ 235,
359
+ 241,
360
+ 242,
361
+ 249,
362
+ 251,
363
+ 254,
364
+ 258,
365
+ 259,
366
+ 260,
367
+ 261,
368
+ 262,
369
+ 265,
370
+ 266,
371
+ 268,
372
+ 270,
373
+ 275,
374
+ 277,
375
+ 278,
376
+ 280,
377
+ 284,
378
+ 286,
379
+ 287,
380
+ 289,
381
+ 291,
382
+ 293,
383
+ 296,
384
+ 297,
385
+ 302,
386
+ 304,
387
+ 305,
388
+ 308,
389
+ 310,
390
+ 311,
391
+ 312,
392
+ 317,
393
+ 322,
394
+ 328,
395
+ 329,
396
+ 332,
397
+ 338,
398
+ 341,
399
+ 342,
400
+ 344,
401
+ 345,
402
+ 349,
403
+ 353,
404
+ 364,
405
+ 365,
406
+ 368,
407
+ 369,
408
+ 373,
409
+ 377,
410
+ 378,
411
+ 382,
412
+ 385,
413
+ 387,
414
+ 389,
415
+ 393,
416
+ 394,
417
+ 396,
418
+ 398,
419
+ 399,
420
+ 400,
421
+ 401,
422
+ 405,
423
+ 408,
424
+ 411,
425
+ 412,
426
+ 413,
427
+ 417,
428
+ 422,
429
+ 425,
430
+ 427,
431
+ 428,
432
+ 432,
433
+ 433,
434
+ 436,
435
+ 438,
436
+ 440,
437
+ 442,
438
+ 446,
439
+ 448,
440
+ 452,
441
+ 455,
442
+ 456,
443
+ 457,
444
+ 460,
445
+ 464,
446
+ 466,
447
+ 468,
448
+ 469,
449
+ 470,
450
+ 475,
451
+ 479,
452
+ 482,
453
+ 484,
454
+ 486,
455
+ 491,
456
+ 497,
457
+ 498,
458
+ 501,
459
+ 505,
460
+ 510,
461
+ 511,
462
+ 515,
463
+ 517,
464
+ 518,
465
+ 523,
466
+ 524,
467
+ 527,
468
+ 531,
469
+ 532,
470
+ 544,
471
+ 549,
472
+ 552,
473
+ 553,
474
+ 555,
475
+ 556,
476
+ 557,
477
+ 558,
478
+ 561,
479
+ 565,
480
+ 573,
481
+ 576,
482
+ 578,
483
+ 581,
484
+ 582,
485
+ 583,
486
+ 587,
487
+ 589,
488
+ 590,
489
+ 594,
490
+ 596,
491
+ 597,
492
+ 599,
493
+ 601,
494
+ 602,
495
+ 604,
496
+ 608,
497
+ 610,
498
+ 611,
499
+ 615,
500
+ 619,
501
+ 623,
502
+ 625,
503
+ 629,
504
+ 630,
505
+ 632,
506
+ 633,
507
+ 636,
508
+ 639,
509
+ 641,
510
+ 643,
511
+ 645,
512
+ 646,
513
+ 649,
514
+ 652,
515
+ 654,
516
+ 662,
517
+ 666,
518
+ 667,
519
+ 668,
520
+ 670,
521
+ 678,
522
+ 679,
523
+ 681,
524
+ 682,
525
+ 683,
526
+ 687,
527
+ 693,
528
+ 696,
529
+ 697,
530
+ 703,
531
+ 704,
532
+ 707,
533
+ 708,
534
+ 709,
535
+ 711,
536
+ 718,
537
+ 722,
538
+ 723,
539
+ 726,
540
+ 727,
541
+ 730,
542
+ 733,
543
+ 738,
544
+ 740,
545
+ 742,
546
+ 744,
547
+ 745,
548
+ 747,
549
+ 750,
550
+ 751,
551
+ 752,
552
+ 755,
553
+ 756,
554
+ 758,
555
+ 759,
556
+ 761,
557
+ 762,
558
+ 766,
559
+ 768,
560
+ 769,
561
+ 775,
562
+ 776,
563
+ 777,
564
+ 780,
565
+ 781,
566
+ 786,
567
+ 788,
568
+ 792,
569
+ 795,
570
+ 796,
571
+ 799,
572
+ 800,
573
+ 802,
574
+ 804,
575
+ 808,
576
+ 813,
577
+ 817,
578
+ 819,
579
+ 826,
580
+ 829,
581
+ 834,
582
+ 837,
583
+ 845,
584
+ 851,
585
+ 852,
586
+ 858,
587
+ 863,
588
+ 864,
589
+ 865,
590
+ 870,
591
+ 871,
592
+ 876,
593
+ 878,
594
+ 880,
595
+ 885,
596
+ 886,
597
+ 887,
598
+ 889,
599
+ 891,
600
+ 892,
601
+ 896,
602
+ 897,
603
+ 898,
604
+ 902,
605
+ 909,
606
+ 910,
607
+ 914,
608
+ 917,
609
+ 919,
610
+ 924,
611
+ 926,
612
+ 928,
613
+ 934,
614
+ 939,
615
+ 943,
616
+ 945,
617
+ 948,
618
+ 951,
619
+ 953,
620
+ 955,
621
+ 956,
622
+ 957,
623
+ 959,
624
+ 960,
625
+ 961,
626
+ 966,
627
+ 971,
628
+ 973,
629
+ 976,
630
+ 977,
631
+ 978,
632
+ 981,
633
+ 983,
634
+ 986,
635
+ 990,
636
+ 991,
637
+ 994,
638
+ 995,
639
+ 999,
640
+ -999,
641
+ -995,
642
+ -994,
643
+ -991,
644
+ -990,
645
+ -986,
646
+ -983,
647
+ -981,
648
+ -978,
649
+ -977,
650
+ -976,
651
+ -973,
652
+ -971,
653
+ -966,
654
+ -961,
655
+ -960,
656
+ -959,
657
+ -957,
658
+ -956,
659
+ -955,
660
+ -953,
661
+ -951,
662
+ -948,
663
+ -945,
664
+ -943,
665
+ -939,
666
+ -934,
667
+ -928,
668
+ -926,
669
+ -924,
670
+ -919,
671
+ -917,
672
+ -914,
673
+ -910,
674
+ -909,
675
+ -902,
676
+ -898,
677
+ -897,
678
+ -896,
679
+ -892,
680
+ -891,
681
+ -889,
682
+ -887,
683
+ -886,
684
+ -885,
685
+ -880,
686
+ -878,
687
+ -876,
688
+ -871,
689
+ -870,
690
+ -865,
691
+ -864,
692
+ -863,
693
+ -858,
694
+ -852,
695
+ -851,
696
+ -845,
697
+ -837,
698
+ -834,
699
+ -829,
700
+ -826,
701
+ -819,
702
+ -817,
703
+ -813,
704
+ -808,
705
+ -804,
706
+ -802,
707
+ -800,
708
+ -799,
709
+ -796,
710
+ -795,
711
+ -792,
712
+ -788,
713
+ -786,
714
+ -781,
715
+ -780,
716
+ -777,
717
+ -776,
718
+ -775,
719
+ -769,
720
+ -768,
721
+ -766,
722
+ -762,
723
+ -761,
724
+ -759,
725
+ -758,
726
+ -756,
727
+ -755,
728
+ -752,
729
+ -751,
730
+ -750,
731
+ -747,
732
+ -745,
733
+ -744,
734
+ -742,
735
+ -740,
736
+ -738,
737
+ -733,
738
+ -730,
739
+ -727,
740
+ -726,
741
+ -723,
742
+ -722,
743
+ -718,
744
+ -711,
745
+ -709,
746
+ -708,
747
+ -707,
748
+ -704,
749
+ -703,
750
+ -697,
751
+ -696,
752
+ -693,
753
+ -687,
754
+ -683,
755
+ -682,
756
+ -681,
757
+ -679,
758
+ -678,
759
+ -670,
760
+ -668,
761
+ -667,
762
+ -666,
763
+ -662,
764
+ -654,
765
+ -652,
766
+ -649,
767
+ -646,
768
+ -645,
769
+ -643,
770
+ -641,
771
+ -639,
772
+ -636,
773
+ -633,
774
+ -632,
775
+ -630,
776
+ -629,
777
+ -625,
778
+ -623,
779
+ -619,
780
+ -615,
781
+ -611,
782
+ -610,
783
+ -608,
784
+ -604,
785
+ -602,
786
+ -601,
787
+ -599,
788
+ -597,
789
+ -596,
790
+ -594,
791
+ -590,
792
+ -589,
793
+ -587,
794
+ -583,
795
+ -582,
796
+ -581,
797
+ -578,
798
+ -576,
799
+ -573,
800
+ -565,
801
+ -561,
802
+ -558,
803
+ -557,
804
+ -556,
805
+ -555,
806
+ -553,
807
+ -552,
808
+ -549,
809
+ -544,
810
+ -532,
811
+ -531,
812
+ -527,
813
+ -524,
814
+ -523,
815
+ -518,
816
+ -517,
817
+ -515,
818
+ -511,
819
+ -510,
820
+ -505,
821
+ -501,
822
+ -498,
823
+ -497,
824
+ -491,
825
+ -486,
826
+ -484,
827
+ -482,
828
+ -479,
829
+ -475,
830
+ -470,
831
+ -469,
832
+ -468,
833
+ -466,
834
+ -464,
835
+ -460,
836
+ -457,
837
+ -456,
838
+ -455,
839
+ -452,
840
+ -448,
841
+ -446,
842
+ -442,
843
+ -440,
844
+ -438,
845
+ -436,
846
+ -433,
847
+ -432,
848
+ -428,
849
+ -427,
850
+ -425,
851
+ -422,
852
+ -417,
853
+ -413,
854
+ -412,
855
+ -411,
856
+ -408,
857
+ -405,
858
+ -401,
859
+ -400,
860
+ -399,
861
+ -398,
862
+ -396,
863
+ -394,
864
+ -393,
865
+ -389,
866
+ -387,
867
+ -385,
868
+ -382,
869
+ -378,
870
+ -377,
871
+ -373,
872
+ -369,
873
+ -368,
874
+ -365,
875
+ -364,
876
+ -353,
877
+ -349,
878
+ -345,
879
+ -344,
880
+ -342,
881
+ -341,
882
+ -338,
883
+ -332,
884
+ -329,
885
+ -328,
886
+ -322,
887
+ -317,
888
+ -312,
889
+ -311,
890
+ -310,
891
+ -308,
892
+ -305,
893
+ -304,
894
+ -302,
895
+ -297,
896
+ -296,
897
+ -293,
898
+ -291,
899
+ -289,
900
+ -287,
901
+ -286,
902
+ -284,
903
+ -280,
904
+ -278,
905
+ -277,
906
+ -275,
907
+ -270,
908
+ -268,
909
+ -266,
910
+ -265,
911
+ -262,
912
+ -261,
913
+ -260,
914
+ -259,
915
+ -258,
916
+ -254,
917
+ -251,
918
+ -249,
919
+ -242,
920
+ -241,
921
+ -235,
922
+ -233,
923
+ -231,
924
+ -229,
925
+ -227,
926
+ -223,
927
+ -220,
928
+ -219,
929
+ -218,
930
+ -214,
931
+ -213,
932
+ -211,
933
+ -206,
934
+ -204,
935
+ -196,
936
+ -195,
937
+ -192,
938
+ -191,
939
+ -184,
940
+ -176,
941
+ -169,
942
+ -166,
943
+ -161,
944
+ -152,
945
+ -151,
946
+ -149,
947
+ -147,
948
+ -142,
949
+ -140,
950
+ -133,
951
+ -132,
952
+ -127,
953
+ -126,
954
+ -125,
955
+ -122,
956
+ -121,
957
+ -118,
958
+ -114,
959
+ -109,
960
+ -108,
961
+ -107,
962
+ -106,
963
+ -103,
964
+ -89,
965
+ -88,
966
+ -84,
967
+ -82,
968
+ -80,
969
+ -78,
970
+ -75,
971
+ -74,
972
+ -69,
973
+ -67,
974
+ -64,
975
+ -60,
976
+ -52,
977
+ -50,
978
+ -47,
979
+ -44,
980
+ -38,
981
+ -34,
982
+ -32,
983
+ -30,
984
+ -29,
985
+ -26,
986
+ -24,
987
+ -21,
988
+ -15,
989
+ -11,
990
+ -10,
991
+ -9,
992
+ -8,
993
+ -5
994
+ ],
995
+ "output": 999
996
+ },
997
+ {
998
+ "input": [
999
+ -508,
1000
+ 5,
1001
+ -762,
1002
+ 775,
1003
+ -248,
1004
+ 522,
1005
+ -234,
1006
+ 31,
1007
+ -992,
1008
+ 289,
1009
+ 804,
1010
+ -220,
1011
+ -729,
1012
+ -468,
1013
+ 45,
1014
+ 558,
1015
+ 52,
1016
+ -203,
1017
+ -970,
1018
+ -967,
1019
+ 315,
1020
+ -709,
1021
+ 573,
1022
+ -448,
1023
+ 577,
1024
+ 67,
1025
+ 71,
1026
+ 842,
1027
+ 75,
1028
+ 844,
1029
+ -944,
1030
+ 337,
1031
+ 849,
1032
+ -938,
1033
+ -674,
1034
+ 607,
1035
+ -927,
1036
+ -924,
1037
+ 871,
1038
+ 872,
1039
+ 617,
1040
+ -141,
1041
+ 630,
1042
+ -394,
1043
+ -643,
1044
+ 383,
1045
+ -383,
1046
+ 643,
1047
+ 394,
1048
+ -630,
1049
+ 141,
1050
+ -617,
1051
+ -872,
1052
+ -871,
1053
+ 924,
1054
+ 927,
1055
+ -607,
1056
+ 674,
1057
+ 938,
1058
+ -337,
1059
+ 944,
1060
+ -849,
1061
+ -844,
1062
+ -75,
1063
+ -842,
1064
+ -71,
1065
+ -67,
1066
+ -577,
1067
+ 448,
1068
+ -573,
1069
+ 709,
1070
+ -315,
1071
+ 967,
1072
+ 970,
1073
+ 203,
1074
+ -52,
1075
+ -558,
1076
+ -45,
1077
+ 468,
1078
+ 729,
1079
+ 220,
1080
+ -804,
1081
+ -289,
1082
+ 992,
1083
+ -31,
1084
+ 234,
1085
+ -522,
1086
+ 248,
1087
+ -775,
1088
+ 762,
1089
+ -5,
1090
+ 508
1091
+ ],
1092
+ "output": 992
1093
+ },
1094
+ {
1095
+ "input": [
1096
+ 3,
1097
+ 6,
1098
+ -506,
1099
+ -505,
1100
+ 523,
1101
+ 526,
1102
+ 18,
1103
+ -494,
1104
+ 537,
1105
+ -486,
1106
+ 29,
1107
+ -989,
1108
+ -475,
1109
+ -979,
1110
+ 49,
1111
+ -975,
1112
+ 566,
1113
+ 55,
1114
+ 576,
1115
+ -954,
1116
+ 71,
1117
+ 585,
1118
+ -438,
1119
+ -434,
1120
+ -945,
1121
+ -430,
1122
+ -927,
1123
+ -409,
1124
+ -918,
1125
+ 620,
1126
+ -402,
1127
+ 632,
1128
+ -904,
1129
+ -901,
1130
+ 130,
1131
+ -879,
1132
+ -367,
1133
+ 659,
1134
+ 150,
1135
+ 151,
1136
+ -872,
1137
+ 665,
1138
+ -871,
1139
+ -357,
1140
+ 668,
1141
+ -862,
1142
+ -346,
1143
+ 682,
1144
+ 170,
1145
+ 172,
1146
+ -337,
1147
+ -335,
1148
+ -328,
1149
+ -838,
1150
+ -837,
1151
+ -830,
1152
+ -312,
1153
+ -822,
1154
+ -307,
1155
+ -306,
1156
+ 720,
1157
+ 210,
1158
+ -298,
1159
+ 728,
1160
+ 222,
1161
+ 735,
1162
+ -289,
1163
+ -287,
1164
+ 738,
1165
+ 739,
1166
+ -286,
1167
+ -283,
1168
+ -792,
1169
+ 746,
1170
+ 235,
1171
+ -790,
1172
+ 749,
1173
+ -272,
1174
+ 753,
1175
+ -782,
1176
+ 758,
1177
+ 253,
1178
+ -771,
1179
+ 771,
1180
+ -253,
1181
+ -758,
1182
+ 782,
1183
+ -753,
1184
+ 272,
1185
+ -749,
1186
+ -235,
1187
+ 790,
1188
+ -746,
1189
+ 792,
1190
+ 283,
1191
+ -739,
1192
+ 286,
1193
+ 287,
1194
+ -738,
1195
+ 289,
1196
+ -735,
1197
+ -222,
1198
+ -728,
1199
+ 298,
1200
+ -210,
1201
+ -720,
1202
+ 306,
1203
+ 307,
1204
+ 822,
1205
+ 312,
1206
+ 830,
1207
+ 837,
1208
+ 838,
1209
+ 328,
1210
+ 335,
1211
+ 337,
1212
+ -172,
1213
+ -682,
1214
+ -170,
1215
+ 346,
1216
+ 862,
1217
+ -668,
1218
+ 357,
1219
+ 871,
1220
+ 872,
1221
+ -665,
1222
+ -151,
1223
+ -150,
1224
+ -659,
1225
+ 879,
1226
+ 367,
1227
+ -130,
1228
+ 901,
1229
+ 904,
1230
+ -632,
1231
+ 402,
1232
+ -620,
1233
+ 918,
1234
+ 409,
1235
+ 927,
1236
+ 430,
1237
+ 945,
1238
+ 434,
1239
+ 438,
1240
+ -585,
1241
+ -71,
1242
+ 954,
1243
+ -576,
1244
+ -55,
1245
+ -566,
1246
+ 975,
1247
+ -49,
1248
+ 979,
1249
+ 475,
1250
+ 989,
1251
+ -6,
1252
+ -29,
1253
+ 486,
1254
+ -537,
1255
+ 494,
1256
+ -18,
1257
+ -526,
1258
+ -523,
1259
+ 505,
1260
+ 506,
1261
+ -3
1262
+ ],
1263
+ "output": 989
1264
+ },
1265
+ {
1266
+ "input": [
1267
+ 1,
1268
+ 4,
1269
+ 5,
1270
+ 6,
1271
+ 11,
1272
+ 14,
1273
+ 16,
1274
+ 20,
1275
+ 24,
1276
+ -998,
1277
+ 30,
1278
+ 32,
1279
+ -990,
1280
+ 37,
1281
+ 38,
1282
+ 40,
1283
+ -984,
1284
+ -981,
1285
+ 47,
1286
+ -977,
1287
+ 52,
1288
+ 53,
1289
+ 54,
1290
+ 55,
1291
+ -971,
1292
+ -967,
1293
+ 60,
1294
+ -964,
1295
+ -961,
1296
+ -960,
1297
+ -958,
1298
+ -957,
1299
+ 69,
1300
+ -953,
1301
+ -951,
1302
+ 74,
1303
+ 76,
1304
+ -948,
1305
+ -941,
1306
+ -939,
1307
+ -938,
1308
+ 88,
1309
+ -934,
1310
+ -931,
1311
+ 94,
1312
+ 97,
1313
+ 98,
1314
+ -927,
1315
+ 100,
1316
+ -926,
1317
+ -924,
1318
+ -922,
1319
+ 105,
1320
+ 106,
1321
+ -916,
1322
+ 113,
1323
+ 114,
1324
+ -909,
1325
+ 116,
1326
+ -904,
1327
+ 121,
1328
+ 123,
1329
+ -900,
1330
+ -899,
1331
+ -896,
1332
+ 129,
1333
+ 132,
1334
+ 133,
1335
+ -890,
1336
+ 138,
1337
+ 139,
1338
+ -883,
1339
+ 146,
1340
+ 147,
1341
+ -878,
1342
+ 151,
1343
+ 152,
1344
+ -873,
1345
+ -872,
1346
+ -870,
1347
+ -871,
1348
+ 157,
1349
+ -867,
1350
+ 159,
1351
+ -866,
1352
+ -864,
1353
+ -860,
1354
+ 165,
1355
+ -858,
1356
+ -856,
1357
+ -854,
1358
+ -852,
1359
+ -850,
1360
+ 179,
1361
+ 180,
1362
+ -845,
1363
+ -841,
1364
+ -838,
1365
+ 192,
1366
+ 193,
1367
+ -832,
1368
+ -830,
1369
+ 196,
1370
+ -819,
1371
+ 206,
1372
+ -817,
1373
+ 209,
1374
+ -813,
1375
+ -812,
1376
+ 214,
1377
+ 216,
1378
+ 217,
1379
+ -805,
1380
+ -803,
1381
+ 225,
1382
+ 228,
1383
+ 231,
1384
+ -793,
1385
+ -792,
1386
+ -791,
1387
+ -789,
1388
+ -788,
1389
+ 240,
1390
+ 241,
1391
+ -783,
1392
+ 244,
1393
+ -780,
1394
+ -779,
1395
+ 248,
1396
+ 252,
1397
+ -769,
1398
+ -761,
1399
+ -760,
1400
+ 269,
1401
+ 273,
1402
+ 278,
1403
+ -746,
1404
+ -743,
1405
+ 282,
1406
+ 283,
1407
+ -741,
1408
+ 287,
1409
+ -736,
1410
+ 289,
1411
+ 292,
1412
+ 293,
1413
+ -731,
1414
+ -730,
1415
+ 300,
1416
+ -722,
1417
+ 305,
1418
+ -718,
1419
+ 307,
1420
+ -714,
1421
+ 316,
1422
+ 322,
1423
+ -700,
1424
+ -696,
1425
+ -695,
1426
+ -693,
1427
+ 334,
1428
+ 335,
1429
+ 337,
1430
+ -687,
1431
+ -686,
1432
+ 341,
1433
+ 344,
1434
+ -680,
1435
+ 347,
1436
+ 348,
1437
+ -674,
1438
+ 351,
1439
+ -673,
1440
+ 353,
1441
+ 354,
1442
+ -671,
1443
+ 356,
1444
+ -668,
1445
+ -666,
1446
+ 359,
1447
+ -661,
1448
+ 366,
1449
+ -658,
1450
+ 368,
1451
+ 369,
1452
+ -657,
1453
+ -655,
1454
+ -654,
1455
+ -652,
1456
+ -651,
1457
+ 376,
1458
+ 379,
1459
+ -643,
1460
+ -642,
1461
+ 383,
1462
+ 385,
1463
+ -639,
1464
+ 387,
1465
+ -634,
1466
+ 391,
1467
+ -633,
1468
+ -631,
1469
+ -629,
1470
+ 396,
1471
+ 397,
1472
+ 399,
1473
+ 402,
1474
+ -621,
1475
+ -620,
1476
+ -618,
1477
+ 408,
1478
+ -612,
1479
+ -609,
1480
+ 417,
1481
+ -607,
1482
+ 420,
1483
+ 422,
1484
+ 427,
1485
+ -597,
1486
+ -594,
1487
+ -592,
1488
+ 435,
1489
+ 437,
1490
+ 441,
1491
+ -583,
1492
+ -582,
1493
+ 446,
1494
+ 447,
1495
+ 448,
1496
+ -576,
1497
+ 450,
1498
+ 451,
1499
+ 452,
1500
+ -574,
1501
+ -570,
1502
+ 455,
1503
+ -569,
1504
+ 460,
1505
+ -562,
1506
+ 464,
1507
+ 465,
1508
+ -549,
1509
+ 477,
1510
+ 479,
1511
+ 480,
1512
+ -539,
1513
+ -538,
1514
+ 487,
1515
+ 489,
1516
+ 490,
1517
+ -531,
1518
+ 494,
1519
+ -530,
1520
+ 496,
1521
+ -529,
1522
+ -527,
1523
+ 501,
1524
+ 504,
1525
+ 510,
1526
+ -510,
1527
+ -504,
1528
+ -501,
1529
+ 527,
1530
+ -496,
1531
+ 529,
1532
+ 530,
1533
+ 531,
1534
+ -494,
1535
+ -490,
1536
+ -489,
1537
+ -487,
1538
+ 538,
1539
+ 539,
1540
+ -480,
1541
+ -479,
1542
+ -477,
1543
+ 549,
1544
+ -465,
1545
+ -464,
1546
+ 562,
1547
+ -460,
1548
+ 569,
1549
+ 570,
1550
+ -455,
1551
+ -452,
1552
+ -451,
1553
+ 574,
1554
+ -450,
1555
+ 576,
1556
+ -448,
1557
+ -447,
1558
+ -446,
1559
+ 582,
1560
+ 583,
1561
+ -441,
1562
+ -437,
1563
+ -435,
1564
+ 592,
1565
+ 594,
1566
+ 597,
1567
+ -427,
1568
+ -422,
1569
+ -420,
1570
+ 607,
1571
+ -417,
1572
+ 609,
1573
+ 612,
1574
+ -408,
1575
+ 618,
1576
+ 620,
1577
+ 621,
1578
+ -402,
1579
+ -399,
1580
+ -397,
1581
+ -396,
1582
+ 629,
1583
+ 631,
1584
+ 633,
1585
+ 634,
1586
+ -391,
1587
+ -387,
1588
+ 639,
1589
+ -385,
1590
+ -383,
1591
+ 642,
1592
+ 643,
1593
+ -379,
1594
+ -376,
1595
+ 651,
1596
+ 652,
1597
+ 654,
1598
+ 655,
1599
+ -369,
1600
+ 657,
1601
+ 658,
1602
+ -368,
1603
+ -366,
1604
+ 661,
1605
+ -359,
1606
+ 666,
1607
+ 668,
1608
+ -356,
1609
+ -354,
1610
+ 671,
1611
+ -353,
1612
+ 673,
1613
+ 674,
1614
+ -351,
1615
+ -348,
1616
+ -347,
1617
+ 680,
1618
+ -344,
1619
+ -341,
1620
+ 686,
1621
+ 687,
1622
+ -337,
1623
+ -335,
1624
+ -334,
1625
+ 693,
1626
+ 695,
1627
+ 696,
1628
+ 700,
1629
+ -322,
1630
+ -316,
1631
+ 714,
1632
+ -307,
1633
+ 718,
1634
+ -305,
1635
+ 722,
1636
+ -300,
1637
+ 730,
1638
+ 731,
1639
+ -292,
1640
+ -293,
1641
+ -289,
1642
+ 736,
1643
+ -287,
1644
+ 741,
1645
+ -283,
1646
+ 743,
1647
+ -282,
1648
+ 746,
1649
+ -278,
1650
+ -273,
1651
+ -269,
1652
+ 760,
1653
+ 761,
1654
+ 769,
1655
+ -252,
1656
+ -248,
1657
+ 779,
1658
+ 780,
1659
+ -244,
1660
+ 783,
1661
+ -241,
1662
+ -240,
1663
+ 788,
1664
+ 789,
1665
+ 791,
1666
+ 792,
1667
+ 793,
1668
+ -231,
1669
+ -228,
1670
+ -225,
1671
+ 803,
1672
+ 805,
1673
+ -217,
1674
+ -216,
1675
+ -214,
1676
+ 812,
1677
+ 813,
1678
+ -209,
1679
+ 817,
1680
+ -206,
1681
+ 819,
1682
+ -196,
1683
+ 830,
1684
+ -193,
1685
+ 832,
1686
+ -192,
1687
+ 838,
1688
+ 841,
1689
+ -180,
1690
+ 845,
1691
+ -179,
1692
+ 850,
1693
+ 852,
1694
+ 854,
1695
+ 856,
1696
+ 858,
1697
+ -165,
1698
+ 860,
1699
+ 864,
1700
+ -159,
1701
+ 866,
1702
+ 867,
1703
+ -157,
1704
+ 870,
1705
+ 871,
1706
+ 872,
1707
+ 873,
1708
+ -152,
1709
+ -151,
1710
+ -147,
1711
+ 878,
1712
+ -146,
1713
+ 883,
1714
+ -139,
1715
+ -138,
1716
+ 890,
1717
+ -133,
1718
+ -132,
1719
+ -129,
1720
+ 896,
1721
+ 899,
1722
+ 900,
1723
+ -123,
1724
+ -121,
1725
+ 904,
1726
+ -116,
1727
+ 909,
1728
+ -114,
1729
+ -113,
1730
+ 916,
1731
+ -106,
1732
+ -105,
1733
+ 922,
1734
+ 924,
1735
+ -100,
1736
+ 926,
1737
+ 927,
1738
+ -98,
1739
+ -97,
1740
+ -94,
1741
+ 931,
1742
+ 934,
1743
+ -88,
1744
+ 938,
1745
+ 939,
1746
+ 941,
1747
+ 948,
1748
+ -76,
1749
+ -74,
1750
+ 951,
1751
+ 953,
1752
+ -69,
1753
+ 957,
1754
+ 958,
1755
+ 960,
1756
+ 961,
1757
+ 964,
1758
+ -60,
1759
+ 967,
1760
+ -55,
1761
+ -54,
1762
+ 971,
1763
+ -53,
1764
+ -52,
1765
+ 977,
1766
+ -47,
1767
+ 981,
1768
+ 984,
1769
+ -40,
1770
+ -38,
1771
+ -37,
1772
+ 990,
1773
+ -32,
1774
+ -30,
1775
+ 998,
1776
+ -24,
1777
+ -20,
1778
+ -16,
1779
+ -14,
1780
+ -11,
1781
+ -6,
1782
+ -5,
1783
+ -4,
1784
+ -1
1785
+ ],
1786
+ "output": 998
1787
+ },
1788
+ {
1789
+ "input": [
1790
+ 8,
1791
+ 10,
1792
+ 11,
1793
+ 16,
1794
+ 21,
1795
+ 28,
1796
+ -989,
1797
+ -988,
1798
+ 40,
1799
+ 44,
1800
+ -979,
1801
+ 54,
1802
+ -970,
1803
+ 57,
1804
+ -963,
1805
+ 63,
1806
+ 65,
1807
+ -952,
1808
+ -951,
1809
+ 74,
1810
+ -950,
1811
+ -949,
1812
+ -946,
1813
+ 81,
1814
+ 82,
1815
+ -940,
1816
+ 85,
1817
+ 97,
1818
+ -927,
1819
+ 103,
1820
+ 105,
1821
+ 107,
1822
+ -917,
1823
+ 112,
1824
+ -907,
1825
+ -905,
1826
+ -904,
1827
+ 123,
1828
+ -897,
1829
+ 134,
1830
+ -890,
1831
+ 136,
1832
+ -888,
1833
+ -883,
1834
+ -880,
1835
+ -879,
1836
+ 151,
1837
+ -864,
1838
+ -863,
1839
+ -862,
1840
+ 163,
1841
+ -861,
1842
+ -857,
1843
+ -855,
1844
+ 170,
1845
+ 171,
1846
+ -852,
1847
+ -850,
1848
+ -848,
1849
+ -847,
1850
+ 179,
1851
+ -845,
1852
+ -844,
1853
+ -840,
1854
+ 185,
1855
+ -839,
1856
+ 187,
1857
+ 194,
1858
+ 198,
1859
+ 199,
1860
+ -826,
1861
+ -824,
1862
+ 202,
1863
+ -813,
1864
+ 213,
1865
+ 220,
1866
+ 222,
1867
+ -802,
1868
+ -801,
1869
+ 226,
1870
+ -793,
1871
+ 242,
1872
+ -778,
1873
+ -777,
1874
+ -774,
1875
+ -768,
1876
+ 261,
1877
+ -762,
1878
+ 263,
1879
+ 264,
1880
+ 265,
1881
+ 280,
1882
+ -741,
1883
+ 284,
1884
+ 288,
1885
+ 290,
1886
+ -734,
1887
+ -731,
1888
+ 295,
1889
+ 303,
1890
+ 306,
1891
+ -715,
1892
+ 318,
1893
+ 324,
1894
+ 325,
1895
+ -700,
1896
+ -694,
1897
+ -689,
1898
+ -685,
1899
+ 340,
1900
+ 344,
1901
+ 345,
1902
+ -676,
1903
+ 354,
1904
+ 356,
1905
+ 357,
1906
+ -664,
1907
+ 363,
1908
+ -658,
1909
+ 370,
1910
+ 373,
1911
+ 375,
1912
+ -648,
1913
+ -645,
1914
+ 380,
1915
+ 381,
1916
+ -644,
1917
+ 383,
1918
+ 384,
1919
+ 387,
1920
+ 389,
1921
+ 390,
1922
+ -635,
1923
+ 394,
1924
+ -629,
1925
+ 397,
1926
+ 398,
1927
+ -627,
1928
+ 401,
1929
+ -618,
1930
+ -616,
1931
+ 410,
1932
+ 411,
1933
+ -611,
1934
+ -607,
1935
+ 422,
1936
+ -599,
1937
+ 427,
1938
+ -586,
1939
+ 439,
1940
+ 451,
1941
+ 453,
1942
+ 454,
1943
+ 457,
1944
+ 465,
1945
+ -559,
1946
+ 471,
1947
+ -552,
1948
+ 473,
1949
+ -550,
1950
+ -547,
1951
+ 479,
1952
+ -541,
1953
+ 484,
1954
+ -540,
1955
+ 489,
1956
+ 490,
1957
+ 491,
1958
+ -532,
1959
+ 493,
1960
+ 497,
1961
+ 498,
1962
+ 500,
1963
+ 511,
1964
+ -513,
1965
+ 513,
1966
+ -511,
1967
+ -500,
1968
+ -498,
1969
+ -497,
1970
+ -493,
1971
+ 532,
1972
+ -491,
1973
+ -490,
1974
+ -489,
1975
+ 540,
1976
+ 541,
1977
+ -484,
1978
+ -479,
1979
+ 547,
1980
+ 550,
1981
+ -473,
1982
+ 552,
1983
+ -471,
1984
+ 559,
1985
+ -465,
1986
+ -457,
1987
+ -454,
1988
+ -453,
1989
+ -451,
1990
+ -439,
1991
+ 586,
1992
+ -427,
1993
+ 599,
1994
+ -422,
1995
+ 607,
1996
+ 611,
1997
+ -411,
1998
+ -410,
1999
+ 616,
2000
+ 618,
2001
+ -401,
2002
+ -398,
2003
+ 627,
2004
+ -397,
2005
+ 629,
2006
+ -394,
2007
+ -390,
2008
+ 635,
2009
+ -389,
2010
+ -387,
2011
+ -384,
2012
+ -383,
2013
+ -381,
2014
+ 644,
2015
+ 645,
2016
+ -380,
2017
+ 648,
2018
+ -375,
2019
+ -373,
2020
+ -370,
2021
+ 658,
2022
+ -363,
2023
+ 664,
2024
+ -357,
2025
+ -356,
2026
+ -354,
2027
+ 676,
2028
+ -345,
2029
+ -344,
2030
+ -340,
2031
+ 685,
2032
+ 689,
2033
+ 694,
2034
+ -325,
2035
+ 700,
2036
+ -324,
2037
+ -318,
2038
+ 715,
2039
+ -306,
2040
+ -303,
2041
+ -295,
2042
+ 731,
2043
+ 734,
2044
+ -290,
2045
+ -288,
2046
+ -284,
2047
+ 741,
2048
+ -280,
2049
+ -265,
2050
+ -264,
2051
+ -263,
2052
+ 762,
2053
+ -261,
2054
+ 768,
2055
+ 774,
2056
+ 777,
2057
+ 778,
2058
+ -242,
2059
+ 793,
2060
+ -226,
2061
+ 801,
2062
+ 802,
2063
+ -222,
2064
+ -220,
2065
+ -213,
2066
+ 813,
2067
+ -202,
2068
+ 824,
2069
+ -199,
2070
+ 826,
2071
+ -198,
2072
+ -194,
2073
+ -187,
2074
+ 839,
2075
+ 840,
2076
+ -185,
2077
+ 844,
2078
+ 845,
2079
+ -179,
2080
+ 847,
2081
+ 848,
2082
+ 850,
2083
+ 852,
2084
+ -171,
2085
+ -170,
2086
+ 855,
2087
+ 857,
2088
+ 861,
2089
+ 862,
2090
+ 863,
2091
+ 864,
2092
+ -163,
2093
+ -151,
2094
+ 879,
2095
+ 880,
2096
+ 883,
2097
+ 888,
2098
+ -136,
2099
+ 890,
2100
+ -134,
2101
+ 897,
2102
+ -123,
2103
+ 904,
2104
+ 905,
2105
+ 907,
2106
+ -112,
2107
+ 917,
2108
+ -107,
2109
+ -105,
2110
+ -103,
2111
+ 927,
2112
+ -97,
2113
+ -85,
2114
+ 940,
2115
+ -82,
2116
+ -81,
2117
+ 946,
2118
+ 949,
2119
+ 950,
2120
+ 951,
2121
+ 952,
2122
+ -74,
2123
+ -65,
2124
+ -63,
2125
+ 963,
2126
+ -57,
2127
+ 970,
2128
+ -54,
2129
+ 979,
2130
+ -44,
2131
+ -40,
2132
+ 988,
2133
+ 989,
2134
+ -28,
2135
+ -21,
2136
+ -16,
2137
+ -11,
2138
+ -10,
2139
+ -8
2140
+ ],
2141
+ "output": 989
2142
+ },
2143
+ {
2144
+ "input": [
2145
+ 4,
2146
+ 7,
2147
+ 10,
2148
+ 14,
2149
+ 28,
2150
+ 30,
2151
+ -993,
2152
+ -988,
2153
+ -987,
2154
+ -985,
2155
+ 40,
2156
+ -984,
2157
+ 44,
2158
+ 46,
2159
+ -977,
2160
+ 53,
2161
+ 55,
2162
+ -968,
2163
+ 61,
2164
+ -962,
2165
+ -960,
2166
+ -957,
2167
+ 73,
2168
+ -942,
2169
+ 83,
2170
+ 87,
2171
+ 89,
2172
+ 90,
2173
+ -933,
2174
+ -930,
2175
+ 95,
2176
+ -928,
2177
+ -920,
2178
+ -919,
2179
+ -917,
2180
+ 109,
2181
+ -912,
2182
+ 113,
2183
+ 115,
2184
+ 116,
2185
+ -907,
2186
+ 120,
2187
+ 121,
2188
+ -903,
2189
+ 123,
2190
+ 126,
2191
+ -888,
2192
+ -887,
2193
+ 143,
2194
+ 146,
2195
+ 149,
2196
+ -873,
2197
+ 152,
2198
+ -870,
2199
+ -868,
2200
+ -866,
2201
+ -863,
2202
+ -862,
2203
+ 169,
2204
+ -855,
2205
+ 171,
2206
+ 172,
2207
+ 175,
2208
+ 179,
2209
+ -840,
2210
+ -839,
2211
+ -837,
2212
+ 188,
2213
+ -836,
2214
+ 196,
2215
+ -825,
2216
+ 202,
2217
+ -821,
2218
+ -815,
2219
+ 224,
2220
+ -798,
2221
+ 231,
2222
+ 233,
2223
+ -788,
2224
+ -785,
2225
+ 240,
2226
+ 241,
2227
+ -784,
2228
+ -783,
2229
+ 248,
2230
+ -774,
2231
+ 252,
2232
+ 253,
2233
+ 254,
2234
+ -772,
2235
+ 265,
2236
+ 266,
2237
+ -753,
2238
+ 279,
2239
+ 280,
2240
+ 281,
2241
+ 284,
2242
+ 291,
2243
+ -732,
2244
+ 294,
2245
+ -730,
2246
+ 299,
2247
+ 300,
2248
+ -724,
2249
+ 303,
2250
+ 308,
2251
+ 310,
2252
+ -714,
2253
+ 316,
2254
+ -704,
2255
+ 321,
2256
+ 322,
2257
+ -700,
2258
+ 332,
2259
+ -689,
2260
+ -685,
2261
+ 342,
2262
+ 344,
2263
+ 350,
2264
+ -674,
2265
+ -672,
2266
+ 354,
2267
+ 358,
2268
+ -662,
2269
+ 365,
2270
+ -658,
2271
+ -657,
2272
+ 369,
2273
+ -654,
2274
+ 376,
2275
+ -647,
2276
+ 378,
2277
+ -645,
2278
+ 382,
2279
+ 384,
2280
+ 385,
2281
+ -640,
2282
+ 387,
2283
+ -638,
2284
+ -636,
2285
+ 391,
2286
+ 396,
2287
+ 400,
2288
+ 401,
2289
+ -623,
2290
+ 403,
2291
+ -621,
2292
+ 407,
2293
+ 413,
2294
+ -605,
2295
+ -604,
2296
+ 423,
2297
+ -600,
2298
+ 426,
2299
+ 427,
2300
+ -589,
2301
+ -587,
2302
+ -584,
2303
+ 442,
2304
+ -579,
2305
+ -578,
2306
+ -573,
2307
+ -565,
2308
+ 462,
2309
+ 466,
2310
+ 468,
2311
+ -556,
2312
+ -554,
2313
+ 471,
2314
+ 473,
2315
+ -551,
2316
+ -550,
2317
+ -548,
2318
+ 477,
2319
+ 483,
2320
+ -540,
2321
+ 491,
2322
+ -531,
2323
+ 495,
2324
+ 496,
2325
+ -528,
2326
+ 500,
2327
+ -524,
2328
+ 508,
2329
+ -515,
2330
+ -514,
2331
+ 514,
2332
+ 515,
2333
+ -508,
2334
+ 524,
2335
+ -500,
2336
+ 528,
2337
+ -496,
2338
+ -495,
2339
+ 531,
2340
+ -491,
2341
+ 540,
2342
+ -483,
2343
+ -477,
2344
+ 548,
2345
+ 550,
2346
+ 551,
2347
+ -473,
2348
+ -471,
2349
+ 554,
2350
+ 556,
2351
+ -468,
2352
+ -466,
2353
+ -462,
2354
+ 565,
2355
+ 573,
2356
+ 578,
2357
+ 579,
2358
+ -442,
2359
+ 584,
2360
+ 587,
2361
+ 589,
2362
+ -427,
2363
+ -426,
2364
+ 600,
2365
+ -423,
2366
+ 604,
2367
+ 605,
2368
+ -413,
2369
+ -407,
2370
+ 621,
2371
+ -403,
2372
+ 623,
2373
+ -401,
2374
+ -400,
2375
+ -396,
2376
+ -391,
2377
+ 636,
2378
+ -387,
2379
+ 638,
2380
+ -385,
2381
+ 640,
2382
+ -384,
2383
+ -382,
2384
+ 645,
2385
+ -378,
2386
+ 647,
2387
+ -376,
2388
+ 654,
2389
+ -369,
2390
+ 657,
2391
+ 658,
2392
+ -365,
2393
+ 662,
2394
+ -358,
2395
+ -354,
2396
+ 672,
2397
+ 674,
2398
+ -350,
2399
+ -344,
2400
+ -342,
2401
+ 685,
2402
+ 689,
2403
+ -332,
2404
+ 700,
2405
+ -322,
2406
+ -321,
2407
+ 704,
2408
+ -316,
2409
+ 714,
2410
+ -310,
2411
+ -308,
2412
+ -303,
2413
+ 724,
2414
+ -300,
2415
+ -299,
2416
+ 730,
2417
+ -294,
2418
+ 732,
2419
+ -291,
2420
+ -284,
2421
+ -281,
2422
+ -280,
2423
+ -279,
2424
+ 753,
2425
+ -266,
2426
+ -265,
2427
+ -254,
2428
+ -253,
2429
+ 772,
2430
+ -252,
2431
+ 774,
2432
+ -248,
2433
+ 783,
2434
+ 784,
2435
+ 785,
2436
+ -240,
2437
+ -241,
2438
+ 788,
2439
+ -233,
2440
+ -231,
2441
+ 798,
2442
+ -224,
2443
+ 815,
2444
+ 821,
2445
+ -202,
2446
+ 825,
2447
+ -196,
2448
+ 836,
2449
+ 837,
2450
+ -188,
2451
+ 839,
2452
+ 840,
2453
+ -179,
2454
+ -175,
2455
+ -172,
2456
+ -171,
2457
+ 855,
2458
+ -169,
2459
+ 862,
2460
+ 863,
2461
+ 866,
2462
+ 868,
2463
+ 870,
2464
+ -152,
2465
+ 873,
2466
+ -149,
2467
+ -146,
2468
+ -143,
2469
+ 887,
2470
+ 888,
2471
+ -126,
2472
+ -123,
2473
+ 903,
2474
+ -121,
2475
+ -120,
2476
+ 907,
2477
+ -116,
2478
+ -115,
2479
+ -113,
2480
+ 912,
2481
+ -109,
2482
+ 917,
2483
+ 919,
2484
+ 920,
2485
+ 928,
2486
+ -95,
2487
+ 930,
2488
+ 933,
2489
+ -90,
2490
+ -89,
2491
+ -87,
2492
+ -83,
2493
+ 942,
2494
+ -73,
2495
+ 957,
2496
+ 960,
2497
+ 962,
2498
+ -61,
2499
+ 968,
2500
+ -55,
2501
+ -53,
2502
+ 977,
2503
+ -46,
2504
+ -44,
2505
+ 984,
2506
+ 985,
2507
+ -40,
2508
+ 987,
2509
+ 988,
2510
+ 993,
2511
+ -30,
2512
+ -28,
2513
+ -14,
2514
+ -10,
2515
+ -7,
2516
+ -4
2517
+ ],
2518
+ "output": 993
2519
+ },
2520
+ {
2521
+ "input": [
2522
+ 516,
2523
+ -764,
2524
+ 11,
2525
+ 15,
2526
+ 530,
2527
+ -231,
2528
+ -484,
2529
+ -736,
2530
+ 36,
2531
+ 295,
2532
+ -982,
2533
+ 557,
2534
+ 815,
2535
+ 563,
2536
+ 55,
2537
+ 823,
2538
+ 825,
2539
+ -969,
2540
+ -455,
2541
+ -196,
2542
+ 323,
2543
+ 581,
2544
+ 330,
2545
+ 335,
2546
+ -431,
2547
+ -687,
2548
+ 339,
2549
+ 595,
2550
+ -937,
2551
+ 856,
2552
+ 602,
2553
+ -165,
2554
+ 93,
2555
+ 869,
2556
+ -409,
2557
+ 618,
2558
+ -662,
2559
+ -146,
2560
+ -655,
2561
+ -398,
2562
+ 893,
2563
+ -893,
2564
+ 398,
2565
+ 655,
2566
+ 146,
2567
+ 662,
2568
+ -618,
2569
+ 409,
2570
+ -869,
2571
+ -93,
2572
+ 165,
2573
+ -602,
2574
+ -856,
2575
+ 937,
2576
+ -339,
2577
+ -595,
2578
+ 431,
2579
+ 687,
2580
+ -335,
2581
+ -330,
2582
+ -581,
2583
+ -323,
2584
+ 196,
2585
+ 455,
2586
+ -825,
2587
+ 969,
2588
+ -55,
2589
+ -823,
2590
+ -563,
2591
+ -815,
2592
+ -557,
2593
+ 982,
2594
+ -295,
2595
+ -36,
2596
+ -516,
2597
+ 736,
2598
+ 484,
2599
+ 231,
2600
+ -530,
2601
+ -15,
2602
+ -11,
2603
+ 764
2604
+ ],
2605
+ "output": 982
2606
+ },
2607
+ {
2608
+ "input": [
2609
+ 771,
2610
+ 517,
2611
+ 262,
2612
+ 522,
2613
+ -500,
2614
+ -499,
2615
+ -497,
2616
+ 784,
2617
+ 275,
2618
+ 276,
2619
+ 532,
2620
+ -489,
2621
+ -487,
2622
+ -231,
2623
+ -229,
2624
+ 806,
2625
+ -986,
2626
+ 553,
2627
+ 298,
2628
+ 43,
2629
+ -213,
2630
+ -979,
2631
+ -723,
2632
+ -209,
2633
+ 563,
2634
+ 52,
2635
+ -716,
2636
+ -968,
2637
+ -711,
2638
+ -197,
2639
+ -707,
2640
+ -451,
2641
+ -960,
2642
+ 833,
2643
+ 834,
2644
+ 322,
2645
+ -446,
2646
+ -190,
2647
+ 585,
2648
+ 329,
2649
+ 75,
2650
+ -431,
2651
+ 595,
2652
+ 339,
2653
+ -173,
2654
+ 343,
2655
+ 856,
2656
+ -425,
2657
+ 346,
2658
+ -167,
2659
+ -169,
2660
+ -931,
2661
+ 354,
2662
+ 611,
2663
+ -158,
2664
+ -155,
2665
+ 614,
2666
+ 871,
2667
+ -666,
2668
+ 364,
2669
+ -147,
2670
+ -659,
2671
+ -145,
2672
+ 112,
2673
+ -916,
2674
+ -140,
2675
+ 119,
2676
+ -649,
2677
+ -902,
2678
+ 894,
2679
+ -894,
2680
+ 902,
2681
+ 649,
2682
+ -119,
2683
+ 140,
2684
+ -112,
2685
+ 145,
2686
+ 147,
2687
+ 659,
2688
+ 916,
2689
+ -364,
2690
+ -871,
2691
+ 666,
2692
+ 155,
2693
+ -614,
2694
+ -611,
2695
+ 158,
2696
+ -354,
2697
+ 931,
2698
+ -346,
2699
+ 167,
2700
+ -856,
2701
+ 425,
2702
+ 169,
2703
+ -343,
2704
+ 173,
2705
+ -595,
2706
+ 431,
2707
+ -339,
2708
+ -75,
2709
+ -585,
2710
+ -329,
2711
+ 446,
2712
+ 190,
2713
+ 960,
2714
+ -834,
2715
+ -833,
2716
+ 707,
2717
+ 451,
2718
+ 197,
2719
+ -322,
2720
+ 711,
2721
+ 968,
2722
+ 716,
2723
+ -52,
2724
+ -563,
2725
+ 209,
2726
+ 979,
2727
+ 723,
2728
+ 213,
2729
+ -43,
2730
+ -298,
2731
+ -553,
2732
+ 986,
2733
+ -806,
2734
+ 229,
2735
+ 487,
2736
+ 231,
2737
+ 489,
2738
+ -276,
2739
+ -532,
2740
+ -275,
2741
+ -784,
2742
+ 497,
2743
+ 499,
2744
+ 500,
2745
+ -522,
2746
+ -262,
2747
+ -517,
2748
+ -771
2749
+ ],
2750
+ "output": 986
2751
+ }
2752
+ ],
2753
+ "haskell_template": "findMaxK :: [Int] -> Int\nfindMaxK nums ",
2754
+ "ocaml_template": "let findMaxK (nums: int list) : int = ",
2755
+ "scala_template": "def findMaxK(nums: List[Int]): Int = { \n \n}",
2756
+ "java_template": "public static int findMaxK(List<Integer> nums) {\n\n}",
2757
+ "python_template": "class Solution(object):\n def findMaxK(self, nums):\n \"\"\"\n :type nums: List[int]\n :rtype: int\n \"\"\"\n "
2758
+ }