DatasetRepo commited on
Commit
c1074a7
·
verified ·
1 Parent(s): 63cf3bb

f7d2bc3d9c9de3eb48f5a72335a4087e03fb4617f3c5ace04dcbcf0adcdb98c9

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 +2 -0
  2. count_hills_and_valleys_in_an_array/ocaml_tests/main.ml +26 -0
  3. count_hills_and_valleys_in_an_array/scala_tests/MySuite.scala +12 -0
  4. count_increasing_quadruplets/.DS_Store +0 -0
  5. count_increasing_quadruplets/haskell_tests/Main.hs +24 -0
  6. count_increasing_quadruplets/java_tests/Main.java +21 -0
  7. count_increasing_quadruplets/meta.json +0 -0
  8. count_increasing_quadruplets/ocaml_tests/main.ml +26 -0
  9. count_increasing_quadruplets/scala_tests/MySuite.scala +12 -0
  10. count_k_reducible_numbers_less_than_n/haskell_tests/Main.hs +45 -0
  11. count_k_reducible_numbers_less_than_n/java_tests/Main.java +25 -0
  12. count_k_reducible_numbers_less_than_n/meta.json +102 -0
  13. count_k_reducible_numbers_less_than_n/ocaml_tests/main.ml +50 -0
  14. count_k_reducible_numbers_less_than_n/scala_tests/MySuite.scala +44 -0
  15. count_k_subsequences_of_a_string_with_maximum_beauty/haskell_tests/Main.hs +0 -0
  16. count_k_subsequences_of_a_string_with_maximum_beauty/java_tests/Main.java +21 -0
  17. count_k_subsequences_of_a_string_with_maximum_beauty/meta.json +0 -0
  18. count_k_subsequences_of_a_string_with_maximum_beauty/ocaml_tests/main.ml +0 -0
  19. count_k_subsequences_of_a_string_with_maximum_beauty/scala_tests/MySuite.scala +0 -0
  20. count_lattice_points_inside_a_circle/.DS_Store +0 -0
  21. count_lattice_points_inside_a_circle/haskell_tests/Main.hs +24 -0
  22. count_lattice_points_inside_a_circle/java_tests/Main.java +21 -0
  23. count_lattice_points_inside_a_circle/meta.json +3807 -0
  24. count_lattice_points_inside_a_circle/ocaml_tests/main.ml +26 -0
  25. count_lattice_points_inside_a_circle/scala_tests/MySuite.scala +12 -0
  26. count_mentions_per_user/java_tests/Main.java +25 -0
  27. count_non_decreasing_subarrays_after_k_operations/haskell_tests/Main.hs +0 -0
  28. count_non_decreasing_subarrays_after_k_operations/java_tests/Main.java +21 -0
  29. count_non_decreasing_subarrays_after_k_operations/meta.json +3 -0
  30. count_non_decreasing_subarrays_after_k_operations/ocaml_tests/main.ml +0 -0
  31. count_non_decreasing_subarrays_after_k_operations/scala_tests/MySuite.scala +0 -0
  32. count_number_of_bad_pairs/.DS_Store +0 -0
  33. count_number_of_bad_pairs/haskell_tests/Main.hs +24 -0
  34. count_number_of_bad_pairs/java_tests/Main.java +21 -0
  35. count_number_of_bad_pairs/meta.json +3 -0
  36. count_number_of_bad_pairs/ocaml_tests/main.ml +26 -0
  37. count_number_of_bad_pairs/scala_tests/MySuite.scala +12 -0
  38. count_number_of_distinct_integers_after_reverse_operations/.DS_Store +0 -0
  39. count_number_of_distinct_integers_after_reverse_operations/haskell_tests/Main.hs +24 -0
  40. count_number_of_distinct_integers_after_reverse_operations/java_tests/Main.java +21 -0
  41. count_number_of_distinct_integers_after_reverse_operations/meta.json +0 -0
  42. count_number_of_distinct_integers_after_reverse_operations/ocaml_tests/main.ml +26 -0
  43. count_number_of_distinct_integers_after_reverse_operations/scala_tests/MySuite.scala +12 -0
  44. count_number_of_possible_root_nodes/.DS_Store +0 -0
  45. count_number_of_possible_root_nodes/haskell_tests/Main.hs +24 -0
  46. count_number_of_possible_root_nodes/java_tests/Main.java +21 -0
  47. count_number_of_possible_root_nodes/meta.json +375 -0
  48. count_number_of_possible_root_nodes/ocaml_tests/main.ml +26 -0
  49. count_number_of_possible_root_nodes/scala_tests/MySuite.scala +12 -0
  50. count_number_of_rectangles_containing_each_point/.DS_Store +0 -0
.gitattributes CHANGED
@@ -77,3 +77,5 @@ count_array_pairs_divisible_by_k/meta.json filter=lfs diff=lfs merge=lfs -text
77
  count_connected_components_in_lcm_graph/meta.json filter=lfs diff=lfs merge=lfs -text
78
  count_days_without_meetings/meta.json filter=lfs diff=lfs merge=lfs -text
79
  count_good_triplets_in_an_array/meta.json filter=lfs diff=lfs merge=lfs -text
 
 
 
77
  count_connected_components_in_lcm_graph/meta.json filter=lfs diff=lfs merge=lfs -text
78
  count_days_without_meetings/meta.json filter=lfs diff=lfs merge=lfs -text
79
  count_good_triplets_in_an_array/meta.json filter=lfs diff=lfs merge=lfs -text
80
+ count_non_decreasing_subarrays_after_k_operations/meta.json filter=lfs diff=lfs merge=lfs -text
81
+ count_number_of_bad_pairs/meta.json filter=lfs diff=lfs merge=lfs -text
count_hills_and_valleys_in_an_array/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 3 (countHillValley [2;4;1;1;6;5])
12
+
13
+ let test2 _ = assert_equal 0 (countHillValley [6;6;5;5;4;1])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for countHillValley" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
count_hills_and_valleys_in_an_array/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.countHillValley(List(2,4,1,1,6,5)), 3)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.countHillValley(List(6,6,5,5,4,1)), 0)
10
+ }
11
+
12
+ }
count_increasing_quadruplets/.DS_Store ADDED
Binary file (6.15 kB). View file
 
count_increasing_quadruplets/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 (countQuadruplets [1,3,2,4,5])," 2 (countQuadruplets [1,3,2,4,5]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (countQuadruplets [1,2,3,4])," 0 (countQuadruplets [1,2,3,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
count_increasing_quadruplets/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(2, countQuadruplets(new ArrayList<>(Arrays.asList(1,3,2,4,5))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(0, countQuadruplets(new ArrayList<>(Arrays.asList(1,2,3,4))));
19
+ }
20
+
21
+ }
count_increasing_quadruplets/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
count_increasing_quadruplets/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 2 (countQuadruplets [1;3;2;4;5])
12
+
13
+ let test2 _ = assert_equal 0 (countQuadruplets [1;2;3;4])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for countQuadruplets" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
count_increasing_quadruplets/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.countQuadruplets(List(1,3,2,4,5)), 2)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.countQuadruplets(List(1,2,3,4)), 0)
10
+ }
11
+
12
+ }
count_k_reducible_numbers_less_than_n/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 (countKReducibleNumbers \"111 \" 1)," 3 (countKReducibleNumbers "111" 1))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (countKReducibleNumbers \"1000 \" 2)," 6 (countKReducibleNumbers "1000" 2))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (countKReducibleNumbers \"1 \" 3)," 0 (countKReducibleNumbers "1" 3))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (countKReducibleNumbers \"10111011110001110011110001101100110100011100101011001111101100101100001110011011001111011101010111001000001111110111000101011011100101101000011111110110101010100100010110001111001011010101111100100100011101111100100101111010101010000111100101001111110001101011000111010101110001111000100100001010110001010110100110101011100101011101000001011101011111001011101101111001100100010001 \" 2)," 520827334 (countKReducibleNumbers "10111011110001110011110001101100110100011100101011001111101100101100001110011011001111011101010111001000001111110111000101011011100101101000011111110110101010100100010110001111001011010101111100100100011101111100100101111010101010000111100101001111110001101011000111010101110001111000100100001010110001010110100110101011100101011101000001011101011111001011101101111001100100010001" 2))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (countKReducibleNumbers \"100011111101000101100100100100011101100000100011101111010010110000001010101110011111110110001010100000111011101011111011011001111101101100010110101111010000101111010011100001011101110000110110111111011001100101100110100010111000000101011111100011100001111000110111010101111011011010011010100011101100110000100111111011111100011001011000001101111000010100010001110110110110110010111011001010001101011001110001110101010 \" 5)," 477882612 (countKReducibleNumbers "100011111101000101100100100100011101100000100011101111010010110000001010101110011111110110001010100000111011101011111011011001111101101100010110101111010000101111010011100001011101110000110110111111011001100101100110100010111000000101011111100011100001111000110111010101111011011010011010100011101100110000100111111011111100011001011000001101111000010100010001110110110110110010111011001010001101011001110001110101010" 5))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (countKReducibleNumbers \"1110010110110111111000101101010100110010010000000111010001101011001110000111001101110101111100110001001000101000110100101010111111000110111010010011011000100101111101110111011110100001001011010101100110011101010101100110001111101110100010000100000001100011110001000100100010010000110000100000010101001001110000100110010000100101000111110100101101110000101101111010000011001111011000110001010101011011001010110101001000100101111101000101001001111101010110111111001011000001011111111011001001100001010111101010111001111010101011100000011000101010011010000001100011100010010 \" 3)," 462393043 (countKReducibleNumbers "1110010110110111111000101101010100110010010000000111010001101011001110000111001101110101111100110001001000101000110100101010111111000110111010010011011000100101111101110111011110100001001011010101100110011101010101100110001111101110100010000100000001100011110001000100100010010000110000100000010101001001110000100110010000100101000111110100101101110000101101111010000011001111011000110001010101011011001010110101001000100101111101000101001001111101010110111111001011000001011111111011001001100001010111101010111001111010101011100000011000101010011010000001100011100010010" 3))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (countKReducibleNumbers \"1111101111111110011000111111100111010110110101111111101010101101001101100101011010011010100011011011101111111101101000111110010111111111100111101001101001000110111000101000101000111011101000100011110010110110010110100010010101111001100001110100000111111011001011110111100100100111011100001110111001101000101110110010000101100001001111010110100000101110100110110101010101110111011110001101100101000000100110000001101010000010111101000001000011101100100100101101001101011111000110010110110000000000011011000111111111000100001110001100100000110011010111001011001101000011011101010110111110011110101010101011010101011001011010000100011001011011010011110011110000001101000000000101111010100101101100011110000101101010111011001010001101010101100010010101001000110 \" 3)," 443977979 (countKReducibleNumbers "1111101111111110011000111111100111010110110101111111101010101101001101100101011010011010100011011011101111111101101000111110010111111111100111101001101001000110111000101000101000111011101000100011110010110110010110100010010101111001100001110100000111111011001011110111100100100111011100001110111001101000101110110010000101100001001111010110100000101110100110110101010101110111011110001101100101000000100110000001101010000010111101000001000011101100100100101101001101011111000110010110110000000000011011000111111111000100001110001100100000110011010111001011001101000011011101010110111110011110101010101011010101011001011010000100011001011011010011110011110000001101000000000101111010100101101100011110000101101010111011001010001101010101100010010101001000110" 3))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (countKReducibleNumbers \"11011111110010110010100101110110100010111011100111110000011010111110110110011101001101011110110100110010110101100010010 \" 3)," 334341265 (countKReducibleNumbers "11011111110010110010100101110110100010111011100111110000011010111110110110011101001101011110110100110010110101100010010" 3))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (countKReducibleNumbers \"1100110011010000110011100111010011111100001110001110100101011011000101111100000001101111110100111000011110100111100101000101001011111010010010001001101001011001011110001001101011010101011000010001100101111100000001111010000101100011111100110111011001100001000010010111011101101010101000000110101111110001000100010111100111100011010001101100110001001110000100101100110110100001100100100011001110100110011001001111100101101100001111011000000100000110110011 \" 5)," 695404935 (countKReducibleNumbers "1100110011010000110011100111010011111100001110001110100101011011000101111100000001101111110100111000011110100111100101000101001011111010010010001001101001011001011110001001101011010101011000010001100101111100000001111010000101100011111100110111011001100001000010010111011101101010101000000110101111110001000100010111100111100011010001101100110001001110000100101100110110100001100100100011001110100110011001001111100101101100001111011000000100000110110011" 5))
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
count_k_reducible_numbers_less_than_n/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, countKReducibleNumbers("111", 1));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(6, countKReducibleNumbers("1000", 2));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(0, countKReducibleNumbers("1", 3));
23
+ }
24
+
25
+ }
count_k_reducible_numbers_less_than_n/meta.json ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3631,
3
+ "name": "count_k_reducible_numbers_less_than_n",
4
+ "difficulty": "Hard",
5
+ "link": "https://leetcode.com/problems/count-k-reducible-numbers-less-than-n/",
6
+ "date": "2024-11-03 00:00:00",
7
+ "task_description": "You are given a **binary** string `s` representing a number `n` in its binary form. You are also given an integer `k`. An integer `x` is called **k-reducible** if performing the following operation **at most** `k` times reduces it to 1: Replace `x` with the **count** of set bits in its binary representation. For example, the binary representation of 6 is `\"110\"`. Applying the operation once reduces it to 2 (since `\"110\"` has two set bits). Applying the operation again to 2 (binary `\"10\"`) reduces it to 1 (since `\"10\"` has one set bit). Return an integer denoting the number of positive integers **less** than `n` that are **k-reducible**. Since the answer may be too large, return it **modulo** `109 + 7`. **Example 1:** **Input:** s = \"111\", k = 1 **Output:** 3 **Explanation: ** `n = 7`. The 1-reducible integers less than 7 are 1, 2, and 4. **Example 2:** **Input:** s = \"1000\", k = 2 **Output:** 6 **Explanation:** `n = 8`. The 2-reducible integers less than 8 are 1, 2, 3, 4, 5, and 6. **Example 3:** **Input:** s = \"1\", k = 3 **Output:** 0 **Explanation:** There are no positive integers less than `n = 1`, so the answer is 0. **Constraints:** `1 <= s.length <= 800` `s` has no leading zeros. `s` consists only of the characters `'0'` and `'1'`. `1 <= k <= 5`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "s = \"111\", k = 1",
12
+ "output": "3 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "s = \"1000\", k = 2",
17
+ "output": "6 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "s = \"1\", k = 3",
22
+ "output": "0 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ "\"10111011110001110011110001101100110100011100101011001111101100101100001110011011001111011101010111001000001111110111000101011011100101101000011111110110101010100100010110001111001011010101111100100100011101111100100101111010101010000111100101001111110001101011000111010101110001111000100100001010110001010110100110101011100101011101000001011101011111001011101101111001100100010001\"",
29
+ 2
30
+ ],
31
+ "output": 520827334
32
+ },
33
+ {
34
+ "input": [
35
+ "\"100011111101000101100100100100011101100000100011101111010010110000001010101110011111110110001010100000111011101011111011011001111101101100010110101111010000101111010011100001011101110000110110111111011001100101100110100010111000000101011111100011100001111000110111010101111011011010011010100011101100110000100111111011111100011001011000001101111000010100010001110110110110110010111011001010001101011001110001110101010\"",
36
+ 5
37
+ ],
38
+ "output": 477882612
39
+ },
40
+ {
41
+ "input": [
42
+ "\"1110010110110111111000101101010100110010010000000111010001101011001110000111001101110101111100110001001000101000110100101010111111000110111010010011011000100101111101110111011110100001001011010101100110011101010101100110001111101110100010000100000001100011110001000100100010010000110000100000010101001001110000100110010000100101000111110100101101110000101101111010000011001111011000110001010101011011001010110101001000100101111101000101001001111101010110111111001011000001011111111011001001100001010111101010111001111010101011100000011000101010011010000001100011100010010\"",
43
+ 3
44
+ ],
45
+ "output": 462393043
46
+ },
47
+ {
48
+ "input": [
49
+ "\"1111101111111110011000111111100111010110110101111111101010101101001101100101011010011010100011011011101111111101101000111110010111111111100111101001101001000110111000101000101000111011101000100011110010110110010110100010010101111001100001110100000111111011001011110111100100100111011100001110111001101000101110110010000101100001001111010110100000101110100110110101010101110111011110001101100101000000100110000001101010000010111101000001000011101100100100101101001101011111000110010110110000000000011011000111111111000100001110001100100000110011010111001011001101000011011101010110111110011110101010101011010101011001011010000100011001011011010011110011110000001101000000000101111010100101101100011110000101101010111011001010001101010101100010010101001000110\"",
50
+ 3
51
+ ],
52
+ "output": 443977979
53
+ },
54
+ {
55
+ "input": [
56
+ "\"11011111110010110010100101110110100010111011100111110000011010111110110110011101001101011110110100110010110101100010010\"",
57
+ 3
58
+ ],
59
+ "output": 334341265
60
+ },
61
+ {
62
+ "input": [
63
+ "\"1100110011010000110011100111010011111100001110001110100101011011000101111100000001101111110100111000011110100111100101000101001011111010010010001001101001011001011110001001101011010101011000010001100101111100000001111010000101100011111100110111011001100001000010010111011101101010101000000110101111110001000100010111100111100011010001101100110001001110000100101100110110100001100100100011001110100110011001001111100101101100001111011000000100000110110011\"",
64
+ 5
65
+ ],
66
+ "output": 695404935
67
+ },
68
+ {
69
+ "input": [
70
+ "\"1000111111101010010011001010011000111101000011010011001101101011100111010111110100111001011100101010110011000100110010000100111100101111011001011001001010100101000111000110111101110010010001000110001101101100100111011011101010111010011010000010111100111101100010110001000111101000101010110101100011000100111010100100110011000111001100001111011111000010000001011010001100111010010010001111000001000000001011001101010110010100100000000110011000\"",
71
+ 1
72
+ ],
73
+ "output": 442
74
+ },
75
+ {
76
+ "input": [
77
+ "1010010010101010000000110001001001001100001011000110000011001001001000111100110011001101011011101010100100110100111110101011100000",
78
+ 2
79
+ ],
80
+ "output": 395325718
81
+ },
82
+ {
83
+ "input": [
84
+ "11010111100101000011110010111110111001000100111001100001100000101100001001010001011001101011001101101011001101101001011101111",
85
+ 3
86
+ ],
87
+ "output": 369901981
88
+ },
89
+ {
90
+ "input": [
91
+ "11110001001110111010101011000101101001111101111011111101000101111000001010011100100011010110001100101101111110000101011101101010001011000001100010010100100010011001110101000011010101001100100110111100010110100100001111110001110000101110100111011011111111000011110101",
92
+ 2
93
+ ],
94
+ "output": 469218050
95
+ }
96
+ ],
97
+ "haskell_template": "countKReducibleNumbers :: String -> Int -> Int\ncountKReducibleNumbers s k ",
98
+ "ocaml_template": "let countKReducibleNumbers (s: string) (k: int) : int = ",
99
+ "scala_template": "def countKReducibleNumbers(s: String,k: Int): Int = { \n \n}",
100
+ "java_template": "class Solution {\n public int countKReducibleNumbers(String s, int k) {\n \n }\n}",
101
+ "python_template": "class Solution(object):\n def countKReducibleNumbers(self, s, k):\n \"\"\"\n :type s: str\n :type k: int\n :rtype: int\n \"\"\"\n "
102
+ }
count_k_reducible_numbers_less_than_n/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 3 (countKReducibleNumbers "111" 1)
12
+
13
+ let test2 _ = assert_equal 6 (countKReducibleNumbers "1000" 2)
14
+
15
+ let test3 _ = assert_equal 0 (countKReducibleNumbers "1" 3)
16
+
17
+ let test4 _ = assert_equal 520827334 (countKReducibleNumbers "10111011110001110011110001101100110100011100101011001111101100101100001110011011001111011101010111001000001111110111000101011011100101101000011111110110101010100100010110001111001011010101111100100100011101111100100101111010101010000111100101001111110001101011000111010101110001111000100100001010110001010110100110101011100101011101000001011101011111001011101101111001100100010001" 2)
18
+
19
+ let test5 _ = assert_equal 477882612 (countKReducibleNumbers "100011111101000101100100100100011101100000100011101111010010110000001010101110011111110110001010100000111011101011111011011001111101101100010110101111010000101111010011100001011101110000110110111111011001100101100110100010111000000101011111100011100001111000110111010101111011011010011010100011101100110000100111111011111100011001011000001101111000010100010001110110110110110010111011001010001101011001110001110101010" 5)
20
+
21
+ let test6 _ = assert_equal 462393043 (countKReducibleNumbers "1110010110110111111000101101010100110010010000000111010001101011001110000111001101110101111100110001001000101000110100101010111111000110111010010011011000100101111101110111011110100001001011010101100110011101010101100110001111101110100010000100000001100011110001000100100010010000110000100000010101001001110000100110010000100101000111110100101101110000101101111010000011001111011000110001010101011011001010110101001000100101111101000101001001111101010110111111001011000001011111111011001001100001010111101010111001111010101011100000011000101010011010000001100011100010010" 3)
22
+
23
+ let test7 _ = assert_equal 443977979 (countKReducibleNumbers "1111101111111110011000111111100111010110110101111111101010101101001101100101011010011010100011011011101111111101101000111110010111111111100111101001101001000110111000101000101000111011101000100011110010110110010110100010010101111001100001110100000111111011001011110111100100100111011100001110111001101000101110110010000101100001001111010110100000101110100110110101010101110111011110001101100101000000100110000001101010000010111101000001000011101100100100101101001101011111000110010110110000000000011011000111111111000100001110001100100000110011010111001011001101000011011101010110111110011110101010101011010101011001011010000100011001011011010011110011110000001101000000000101111010100101101100011110000101101010111011001010001101010101100010010101001000110" 3)
24
+
25
+ let test8 _ = assert_equal 334341265 (countKReducibleNumbers "11011111110010110010100101110110100010111011100111110000011010111110110110011101001101011110110100110010110101100010010" 3)
26
+
27
+ let test9 _ = assert_equal 695404935 (countKReducibleNumbers "1100110011010000110011100111010011111100001110001110100101011011000101111100000001101111110100111000011110100111100101000101001011111010010010001001101001011001011110001001101011010101011000010001100101111100000001111010000101100011111100110111011001100001000010010111011101101010101000000110101111110001000100010111100111100011010001101100110001001110000100101100110110100001100100100011001110100110011001001111100101101100001111011000000100000110110011" 5)
28
+
29
+ let test10 _ = assert_equal 442 (countKReducibleNumbers "1000111111101010010011001010011000111101000011010011001101101011100111010111110100111001011100101010110011000100110010000100111100101111011001011001001010100101000111000110111101110010010001000110001101101100100111011011101010111010011010000010111100111101100010110001000111101000101010110101100011000100111010100100110011000111001100001111011111000010000001011010001100111010010010001111000001000000001011001101010110010100100000000110011000" 1)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for countKReducibleNumbers" >::: [
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
count_k_reducible_numbers_less_than_n/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.countKReducibleNumbers("111",1), 3)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.countKReducibleNumbers("1000",2), 6)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.countKReducibleNumbers("1",3), 0)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.countKReducibleNumbers("10111011110001110011110001101100110100011100101011001111101100101100001110011011001111011101010111001000001111110111000101011011100101101000011111110110101010100100010110001111001011010101111100100100011101111100100101111010101010000111100101001111110001101011000111010101110001111000100100001010110001010110100110101011100101011101000001011101011111001011101101111001100100010001",2), 520827334)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.countKReducibleNumbers("100011111101000101100100100100011101100000100011101111010010110000001010101110011111110110001010100000111011101011111011011001111101101100010110101111010000101111010011100001011101110000110110111111011001100101100110100010111000000101011111100011100001111000110111010101111011011010011010100011101100110000100111111011111100011001011000001101111000010100010001110110110110110010111011001010001101011001110001110101010",5), 477882612)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.countKReducibleNumbers("1110010110110111111000101101010100110010010000000111010001101011001110000111001101110101111100110001001000101000110100101010111111000110111010010011011000100101111101110111011110100001001011010101100110011101010101100110001111101110100010000100000001100011110001000100100010010000110000100000010101001001110000100110010000100101000111110100101101110000101101111010000011001111011000110001010101011011001010110101001000100101111101000101001001111101010110111111001011000001011111111011001001100001010111101010111001111010101011100000011000101010011010000001100011100010010",3), 462393043)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.countKReducibleNumbers("1111101111111110011000111111100111010110110101111111101010101101001101100101011010011010100011011011101111111101101000111110010111111111100111101001101001000110111000101000101000111011101000100011110010110110010110100010010101111001100001110100000111111011001011110111100100100111011100001110111001101000101110110010000101100001001111010110100000101110100110110101010101110111011110001101100101000000100110000001101010000010111101000001000011101100100100101101001101011111000110010110110000000000011011000111111111000100001110001100100000110011010111001011001101000011011101010110111110011110101010101011010101011001011010000100011001011011010011110011110000001101000000000101111010100101101100011110000101101010111011001010001101010101100010010101001000110",3), 443977979)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.countKReducibleNumbers("11011111110010110010100101110110100010111011100111110000011010111110110110011101001101011110110100110010110101100010010",3), 334341265)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.countKReducibleNumbers("1100110011010000110011100111010011111100001110001110100101011011000101111100000001101111110100111000011110100111100101000101001011111010010010001001101001011001011110001001101011010101011000010001100101111100000001111010000101100011111100110111011001100001000010010111011101101010101000000110101111110001000100010111100111100011010001101100110001001110000100101100110110100001100100100011001110100110011001001111100101101100001111011000000100000110110011",5), 695404935)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.countKReducibleNumbers("1000111111101010010011001010011000111101000011010011001101101011100111010111110100111001011100101010110011000100110010000100111100101111011001011001001010100101000111000110111101110010010001000110001101101100100111011011101010111010011010000010111100111101100010110001000111101000101010110101100011000100111010100100110011000111001100001111011111000010000001011010001100111010010010001111000001000000001011001101010110010100100000000110011000",1), 442)
42
+ }
43
+
44
+ }
count_k_subsequences_of_a_string_with_maximum_beauty/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
count_k_subsequences_of_a_string_with_maximum_beauty/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, countKSubsequencesWithMaxBeauty("bcca", 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(2, countKSubsequencesWithMaxBeauty("abbcd", 4));
19
+ }
20
+
21
+ }
count_k_subsequences_of_a_string_with_maximum_beauty/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
count_k_subsequences_of_a_string_with_maximum_beauty/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
count_k_subsequences_of_a_string_with_maximum_beauty/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
count_lattice_points_inside_a_circle/.DS_Store ADDED
Binary file (6.15 kB). View file
 
count_lattice_points_inside_a_circle/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 (countLatticePoints [[2,2,1]])," 5 (countLatticePoints [[2,2,1]]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (countLatticePoints [[2,2,2],[3,4,1]])," 16 (countLatticePoints [[2,2,2],[3,4,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
count_lattice_points_inside_a_circle/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(5, countLatticePoints(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(2,2,1))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(16, countLatticePoints(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(2,2,2)),new ArrayList<>(Arrays.asList(3,4,1))))));
19
+ }
20
+
21
+ }
count_lattice_points_inside_a_circle/meta.json ADDED
@@ -0,0 +1,3807 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2332,
3
+ "name": "count_lattice_points_inside_a_circle",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/count-lattice-points-inside-a-circle/",
6
+ "date": "1650153600000",
7
+ "task_description": "Given a 2D integer array `circles` where `circles[i] = [xi, yi, ri]` represents the center `(xi, yi)` and radius `ri` of the `ith` circle drawn on a grid, return _the **number of lattice points** __that are present inside **at least one** circle_. **Note:** A **lattice point** is a point with integer coordinates. Points that lie **on the circumference of a circle** are also considered to be inside it. **Example 1:** ``` **Input:** circles = [[2,2,1]] **Output:** 5 **Explanation:** The figure above shows the given circle. The lattice points present inside the circle are (1, 2), (2, 1), (2, 2), (2, 3), and (3, 2) and are shown in green. Other points such as (1, 1) and (1, 3), which are shown in red, are not considered inside the circle. Hence, the number of lattice points present inside at least one circle is 5. ``` **Example 2:** ``` **Input:** circles = [[2,2,2],[3,4,1]] **Output:** 16 **Explanation:** The figure above shows the given circles. There are exactly 16 lattice points which are present inside at least one circle. Some of them are (0, 2), (2, 0), (2, 4), (3, 2), and (4, 4). ``` **Constraints:** `1 <= circles.length <= 200` `circles[i].length == 3` `1 <= xi, yi <= 100` `1 <= ri <= min(xi, yi)`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "circles = [[2,2,1]]",
12
+ "output": "5 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "circles = [[2,2,2],[3,4,1]]",
17
+ "output": "16 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ [
24
+ 49,
25
+ 54,
26
+ 28
27
+ ],
28
+ [
29
+ 56,
30
+ 46,
31
+ 44
32
+ ],
33
+ [
34
+ 29,
35
+ 92,
36
+ 23
37
+ ],
38
+ [
39
+ 38,
40
+ 75,
41
+ 11
42
+ ],
43
+ [
44
+ 54,
45
+ 23,
46
+ 22
47
+ ],
48
+ [
49
+ 63,
50
+ 53,
51
+ 40
52
+ ],
53
+ [
54
+ 74,
55
+ 28,
56
+ 16
57
+ ],
58
+ [
59
+ 100,
60
+ 99,
61
+ 34
62
+ ],
63
+ [
64
+ 62,
65
+ 64,
66
+ 26
67
+ ],
68
+ [
69
+ 28,
70
+ 80,
71
+ 8
72
+ ],
73
+ [
74
+ 34,
75
+ 90,
76
+ 5
77
+ ],
78
+ [
79
+ 79,
80
+ 54,
81
+ 40
82
+ ],
83
+ [
84
+ 24,
85
+ 13,
86
+ 5
87
+ ],
88
+ [
89
+ 68,
90
+ 16,
91
+ 12
92
+ ],
93
+ [
94
+ 73,
95
+ 65,
96
+ 38
97
+ ],
98
+ [
99
+ 23,
100
+ 74,
101
+ 12
102
+ ],
103
+ [
104
+ 43,
105
+ 93,
106
+ 4
107
+ ],
108
+ [
109
+ 71,
110
+ 63,
111
+ 62
112
+ ],
113
+ [
114
+ 20,
115
+ 10,
116
+ 9
117
+ ],
118
+ [
119
+ 19,
120
+ 15,
121
+ 12
122
+ ],
123
+ [
124
+ 79,
125
+ 38,
126
+ 18
127
+ ],
128
+ [
129
+ 32,
130
+ 53,
131
+ 31
132
+ ],
133
+ [
134
+ 66,
135
+ 42,
136
+ 25
137
+ ],
138
+ [
139
+ 52,
140
+ 43,
141
+ 4
142
+ ],
143
+ [
144
+ 99,
145
+ 51,
146
+ 19
147
+ ],
148
+ [
149
+ 23,
150
+ 67,
151
+ 7
152
+ ]
153
+ ],
154
+ "output": 14313
155
+ },
156
+ {
157
+ "input": [
158
+ [
159
+ 15,
160
+ 84,
161
+ 15
162
+ ],
163
+ [
164
+ 8,
165
+ 13,
166
+ 7
167
+ ],
168
+ [
169
+ 1,
170
+ 50,
171
+ 1
172
+ ],
173
+ [
174
+ 15,
175
+ 51,
176
+ 6
177
+ ],
178
+ [
179
+ 20,
180
+ 72,
181
+ 7
182
+ ],
183
+ [
184
+ 55,
185
+ 23,
186
+ 2
187
+ ],
188
+ [
189
+ 86,
190
+ 28,
191
+ 6
192
+ ],
193
+ [
194
+ 49,
195
+ 99,
196
+ 31
197
+ ],
198
+ [
199
+ 75,
200
+ 54,
201
+ 19
202
+ ],
203
+ [
204
+ 91,
205
+ 63,
206
+ 56
207
+ ],
208
+ [
209
+ 22,
210
+ 56,
211
+ 11
212
+ ],
213
+ [
214
+ 100,
215
+ 18,
216
+ 8
217
+ ],
218
+ [
219
+ 72,
220
+ 27,
221
+ 15
222
+ ],
223
+ [
224
+ 44,
225
+ 23,
226
+ 20
227
+ ],
228
+ [
229
+ 10,
230
+ 50,
231
+ 6
232
+ ],
233
+ [
234
+ 33,
235
+ 79,
236
+ 25
237
+ ],
238
+ [
239
+ 77,
240
+ 16,
241
+ 10
242
+ ],
243
+ [
244
+ 76,
245
+ 90,
246
+ 73
247
+ ],
248
+ [
249
+ 53,
250
+ 20,
251
+ 12
252
+ ],
253
+ [
254
+ 50,
255
+ 74,
256
+ 10
257
+ ],
258
+ [
259
+ 54,
260
+ 32,
261
+ 6
262
+ ],
263
+ [
264
+ 96,
265
+ 18,
266
+ 3
267
+ ],
268
+ [
269
+ 94,
270
+ 1,
271
+ 1
272
+ ],
273
+ [
274
+ 94,
275
+ 17,
276
+ 3
277
+ ],
278
+ [
279
+ 36,
280
+ 89,
281
+ 36
282
+ ],
283
+ [
284
+ 53,
285
+ 44,
286
+ 34
287
+ ],
288
+ [
289
+ 68,
290
+ 76,
291
+ 28
292
+ ],
293
+ [
294
+ 50,
295
+ 99,
296
+ 15
297
+ ],
298
+ [
299
+ 65,
300
+ 85,
301
+ 27
302
+ ],
303
+ [
304
+ 63,
305
+ 45,
306
+ 35
307
+ ],
308
+ [
309
+ 21,
310
+ 3,
311
+ 2
312
+ ],
313
+ [
314
+ 14,
315
+ 94,
316
+ 1
317
+ ],
318
+ [
319
+ 32,
320
+ 69,
321
+ 17
322
+ ],
323
+ [
324
+ 3,
325
+ 55,
326
+ 3
327
+ ],
328
+ [
329
+ 30,
330
+ 72,
331
+ 16
332
+ ],
333
+ [
334
+ 4,
335
+ 96,
336
+ 2
337
+ ],
338
+ [
339
+ 45,
340
+ 79,
341
+ 36
342
+ ],
343
+ [
344
+ 65,
345
+ 95,
346
+ 24
347
+ ],
348
+ [
349
+ 46,
350
+ 65,
351
+ 34
352
+ ],
353
+ [
354
+ 79,
355
+ 7,
356
+ 5
357
+ ],
358
+ [
359
+ 36,
360
+ 11,
361
+ 6
362
+ ],
363
+ [
364
+ 96,
365
+ 66,
366
+ 45
367
+ ],
368
+ [
369
+ 11,
370
+ 27,
371
+ 3
372
+ ],
373
+ [
374
+ 46,
375
+ 21,
376
+ 21
377
+ ],
378
+ [
379
+ 17,
380
+ 80,
381
+ 13
382
+ ],
383
+ [
384
+ 23,
385
+ 80,
386
+ 10
387
+ ],
388
+ [
389
+ 69,
390
+ 67,
391
+ 18
392
+ ],
393
+ [
394
+ 64,
395
+ 56,
396
+ 3
397
+ ],
398
+ [
399
+ 73,
400
+ 81,
401
+ 31
402
+ ],
403
+ [
404
+ 68,
405
+ 61,
406
+ 44
407
+ ],
408
+ [
409
+ 22,
410
+ 37,
411
+ 11
412
+ ],
413
+ [
414
+ 81,
415
+ 4,
416
+ 1
417
+ ],
418
+ [
419
+ 3,
420
+ 28,
421
+ 1
422
+ ],
423
+ [
424
+ 21,
425
+ 68,
426
+ 16
427
+ ],
428
+ [
429
+ 99,
430
+ 22,
431
+ 3
432
+ ],
433
+ [
434
+ 64,
435
+ 71,
436
+ 16
437
+ ],
438
+ [
439
+ 44,
440
+ 97,
441
+ 13
442
+ ],
443
+ [
444
+ 12,
445
+ 10,
446
+ 4
447
+ ],
448
+ [
449
+ 88,
450
+ 38,
451
+ 15
452
+ ],
453
+ [
454
+ 14,
455
+ 17,
456
+ 8
457
+ ],
458
+ [
459
+ 46,
460
+ 82,
461
+ 6
462
+ ],
463
+ [
464
+ 51,
465
+ 17,
466
+ 2
467
+ ],
468
+ [
469
+ 51,
470
+ 90,
471
+ 29
472
+ ],
473
+ [
474
+ 60,
475
+ 51,
476
+ 29
477
+ ],
478
+ [
479
+ 39,
480
+ 95,
481
+ 37
482
+ ],
483
+ [
484
+ 58,
485
+ 60,
486
+ 50
487
+ ],
488
+ [
489
+ 8,
490
+ 33,
491
+ 8
492
+ ],
493
+ [
494
+ 78,
495
+ 71,
496
+ 33
497
+ ],
498
+ [
499
+ 78,
500
+ 18,
501
+ 1
502
+ ],
503
+ [
504
+ 84,
505
+ 90,
506
+ 6
507
+ ],
508
+ [
509
+ 42,
510
+ 45,
511
+ 15
512
+ ],
513
+ [
514
+ 2,
515
+ 36,
516
+ 1
517
+ ],
518
+ [
519
+ 23,
520
+ 69,
521
+ 15
522
+ ],
523
+ [
524
+ 45,
525
+ 44,
526
+ 39
527
+ ],
528
+ [
529
+ 47,
530
+ 99,
531
+ 4
532
+ ],
533
+ [
534
+ 86,
535
+ 74,
536
+ 35
537
+ ],
538
+ [
539
+ 85,
540
+ 36,
541
+ 12
542
+ ],
543
+ [
544
+ 33,
545
+ 65,
546
+ 33
547
+ ],
548
+ [
549
+ 95,
550
+ 49,
551
+ 35
552
+ ],
553
+ [
554
+ 17,
555
+ 32,
556
+ 10
557
+ ],
558
+ [
559
+ 61,
560
+ 4,
561
+ 2
562
+ ],
563
+ [
564
+ 40,
565
+ 39,
566
+ 14
567
+ ],
568
+ [
569
+ 46,
570
+ 27,
571
+ 11
572
+ ],
573
+ [
574
+ 51,
575
+ 42,
576
+ 29
577
+ ],
578
+ [
579
+ 91,
580
+ 99,
581
+ 72
582
+ ],
583
+ [
584
+ 71,
585
+ 59,
586
+ 12
587
+ ],
588
+ [
589
+ 9,
590
+ 93,
591
+ 5
592
+ ],
593
+ [
594
+ 57,
595
+ 65,
596
+ 51
597
+ ],
598
+ [
599
+ 45,
600
+ 71,
601
+ 17
602
+ ]
603
+ ],
604
+ "output": 22078
605
+ },
606
+ {
607
+ "input": [
608
+ [
609
+ 42,
610
+ 42,
611
+ 32
612
+ ],
613
+ [
614
+ 35,
615
+ 14,
616
+ 11
617
+ ],
618
+ [
619
+ 55,
620
+ 52,
621
+ 33
622
+ ],
623
+ [
624
+ 92,
625
+ 19,
626
+ 11
627
+ ],
628
+ [
629
+ 62,
630
+ 69,
631
+ 38
632
+ ],
633
+ [
634
+ 19,
635
+ 16,
636
+ 5
637
+ ],
638
+ [
639
+ 23,
640
+ 92,
641
+ 1
642
+ ],
643
+ [
644
+ 43,
645
+ 83,
646
+ 14
647
+ ],
648
+ [
649
+ 80,
650
+ 17,
651
+ 5
652
+ ],
653
+ [
654
+ 90,
655
+ 63,
656
+ 17
657
+ ],
658
+ [
659
+ 81,
660
+ 70,
661
+ 50
662
+ ],
663
+ [
664
+ 100,
665
+ 67,
666
+ 34
667
+ ],
668
+ [
669
+ 9,
670
+ 78,
671
+ 4
672
+ ],
673
+ [
674
+ 45,
675
+ 24,
676
+ 15
677
+ ],
678
+ [
679
+ 48,
680
+ 49,
681
+ 9
682
+ ]
683
+ ],
684
+ "output": 10368
685
+ },
686
+ {
687
+ "input": [
688
+ [
689
+ 39,
690
+ 60,
691
+ 39
692
+ ],
693
+ [
694
+ 94,
695
+ 48,
696
+ 22
697
+ ],
698
+ [
699
+ 58,
700
+ 95,
701
+ 15
702
+ ],
703
+ [
704
+ 9,
705
+ 21,
706
+ 1
707
+ ],
708
+ [
709
+ 1,
710
+ 58,
711
+ 1
712
+ ],
713
+ [
714
+ 35,
715
+ 45,
716
+ 15
717
+ ],
718
+ [
719
+ 23,
720
+ 3,
721
+ 3
722
+ ],
723
+ [
724
+ 53,
725
+ 1,
726
+ 1
727
+ ],
728
+ [
729
+ 29,
730
+ 21,
731
+ 3
732
+ ],
733
+ [
734
+ 5,
735
+ 4,
736
+ 3
737
+ ],
738
+ [
739
+ 82,
740
+ 10,
741
+ 2
742
+ ],
743
+ [
744
+ 12,
745
+ 62,
746
+ 6
747
+ ],
748
+ [
749
+ 56,
750
+ 6,
751
+ 4
752
+ ],
753
+ [
754
+ 62,
755
+ 45,
756
+ 28
757
+ ],
758
+ [
759
+ 74,
760
+ 75,
761
+ 19
762
+ ],
763
+ [
764
+ 48,
765
+ 12,
766
+ 9
767
+ ],
768
+ [
769
+ 39,
770
+ 65,
771
+ 24
772
+ ],
773
+ [
774
+ 17,
775
+ 18,
776
+ 14
777
+ ]
778
+ ],
779
+ "output": 8348
780
+ },
781
+ {
782
+ "input": [
783
+ [
784
+ 23,
785
+ 7,
786
+ 2
787
+ ],
788
+ [
789
+ 24,
790
+ 54,
791
+ 11
792
+ ],
793
+ [
794
+ 73,
795
+ 47,
796
+ 9
797
+ ],
798
+ [
799
+ 1,
800
+ 39,
801
+ 1
802
+ ],
803
+ [
804
+ 58,
805
+ 26,
806
+ 18
807
+ ],
808
+ [
809
+ 27,
810
+ 74,
811
+ 18
812
+ ],
813
+ [
814
+ 33,
815
+ 30,
816
+ 15
817
+ ],
818
+ [
819
+ 97,
820
+ 43,
821
+ 16
822
+ ],
823
+ [
824
+ 20,
825
+ 88,
826
+ 10
827
+ ],
828
+ [
829
+ 16,
830
+ 91,
831
+ 13
832
+ ],
833
+ [
834
+ 35,
835
+ 59,
836
+ 27
837
+ ],
838
+ [
839
+ 91,
840
+ 68,
841
+ 12
842
+ ],
843
+ [
844
+ 80,
845
+ 37,
846
+ 12
847
+ ],
848
+ [
849
+ 2,
850
+ 95,
851
+ 2
852
+ ],
853
+ [
854
+ 32,
855
+ 91,
856
+ 18
857
+ ],
858
+ [
859
+ 52,
860
+ 44,
861
+ 30
862
+ ],
863
+ [
864
+ 91,
865
+ 82,
866
+ 7
867
+ ],
868
+ [
869
+ 76,
870
+ 94,
871
+ 63
872
+ ],
873
+ [
874
+ 67,
875
+ 34,
876
+ 14
877
+ ],
878
+ [
879
+ 27,
880
+ 46,
881
+ 20
882
+ ],
883
+ [
884
+ 93,
885
+ 49,
886
+ 7
887
+ ],
888
+ [
889
+ 11,
890
+ 34,
891
+ 10
892
+ ],
893
+ [
894
+ 100,
895
+ 45,
896
+ 39
897
+ ],
898
+ [
899
+ 76,
900
+ 98,
901
+ 46
902
+ ],
903
+ [
904
+ 72,
905
+ 29,
906
+ 12
907
+ ],
908
+ [
909
+ 78,
910
+ 10,
911
+ 8
912
+ ],
913
+ [
914
+ 55,
915
+ 28,
916
+ 18
917
+ ],
918
+ [
919
+ 59,
920
+ 62,
921
+ 35
922
+ ],
923
+ [
924
+ 73,
925
+ 88,
926
+ 26
927
+ ],
928
+ [
929
+ 29,
930
+ 45,
931
+ 22
932
+ ],
933
+ [
934
+ 8,
935
+ 73,
936
+ 8
937
+ ],
938
+ [
939
+ 36,
940
+ 19,
941
+ 2
942
+ ],
943
+ [
944
+ 67,
945
+ 93,
946
+ 40
947
+ ],
948
+ [
949
+ 46,
950
+ 66,
951
+ 6
952
+ ],
953
+ [
954
+ 54,
955
+ 100,
956
+ 13
957
+ ],
958
+ [
959
+ 44,
960
+ 54,
961
+ 23
962
+ ],
963
+ [
964
+ 98,
965
+ 90,
966
+ 70
967
+ ],
968
+ [
969
+ 73,
970
+ 4,
971
+ 3
972
+ ],
973
+ [
974
+ 98,
975
+ 74,
976
+ 15
977
+ ],
978
+ [
979
+ 22,
980
+ 88,
981
+ 18
982
+ ],
983
+ [
984
+ 82,
985
+ 29,
986
+ 4
987
+ ],
988
+ [
989
+ 14,
990
+ 99,
991
+ 1
992
+ ],
993
+ [
994
+ 22,
995
+ 78,
996
+ 20
997
+ ],
998
+ [
999
+ 47,
1000
+ 29,
1001
+ 14
1002
+ ],
1003
+ [
1004
+ 37,
1005
+ 20,
1006
+ 19
1007
+ ],
1008
+ [
1009
+ 60,
1010
+ 22,
1011
+ 11
1012
+ ],
1013
+ [
1014
+ 79,
1015
+ 59,
1016
+ 20
1017
+ ],
1018
+ [
1019
+ 81,
1020
+ 45,
1021
+ 29
1022
+ ],
1023
+ [
1024
+ 38,
1025
+ 93,
1026
+ 7
1027
+ ],
1028
+ [
1029
+ 84,
1030
+ 56,
1031
+ 43
1032
+ ],
1033
+ [
1034
+ 81,
1035
+ 74,
1036
+ 63
1037
+ ],
1038
+ [
1039
+ 7,
1040
+ 82,
1041
+ 7
1042
+ ],
1043
+ [
1044
+ 49,
1045
+ 48,
1046
+ 34
1047
+ ],
1048
+ [
1049
+ 52,
1050
+ 31,
1051
+ 17
1052
+ ],
1053
+ [
1054
+ 31,
1055
+ 21,
1056
+ 1
1057
+ ],
1058
+ [
1059
+ 100,
1060
+ 23,
1061
+ 20
1062
+ ],
1063
+ [
1064
+ 88,
1065
+ 46,
1066
+ 43
1067
+ ],
1068
+ [
1069
+ 27,
1070
+ 99,
1071
+ 21
1072
+ ],
1073
+ [
1074
+ 35,
1075
+ 33,
1076
+ 11
1077
+ ],
1078
+ [
1079
+ 10,
1080
+ 61,
1081
+ 7
1082
+ ],
1083
+ [
1084
+ 63,
1085
+ 11,
1086
+ 9
1087
+ ],
1088
+ [
1089
+ 39,
1090
+ 63,
1091
+ 12
1092
+ ],
1093
+ [
1094
+ 88,
1095
+ 51,
1096
+ 35
1097
+ ],
1098
+ [
1099
+ 15,
1100
+ 34,
1101
+ 12
1102
+ ],
1103
+ [
1104
+ 41,
1105
+ 13,
1106
+ 7
1107
+ ],
1108
+ [
1109
+ 84,
1110
+ 37,
1111
+ 9
1112
+ ],
1113
+ [
1114
+ 38,
1115
+ 24,
1116
+ 9
1117
+ ],
1118
+ [
1119
+ 5,
1120
+ 21,
1121
+ 2
1122
+ ],
1123
+ [
1124
+ 99,
1125
+ 31,
1126
+ 28
1127
+ ],
1128
+ [
1129
+ 55,
1130
+ 61,
1131
+ 8
1132
+ ],
1133
+ [
1134
+ 68,
1135
+ 38,
1136
+ 28
1137
+ ],
1138
+ [
1139
+ 70,
1140
+ 74,
1141
+ 68
1142
+ ],
1143
+ [
1144
+ 61,
1145
+ 29,
1146
+ 16
1147
+ ],
1148
+ [
1149
+ 87,
1150
+ 15,
1151
+ 6
1152
+ ],
1153
+ [
1154
+ 12,
1155
+ 77,
1156
+ 8
1157
+ ],
1158
+ [
1159
+ 67,
1160
+ 11,
1161
+ 5
1162
+ ],
1163
+ [
1164
+ 15,
1165
+ 91,
1166
+ 6
1167
+ ],
1168
+ [
1169
+ 69,
1170
+ 82,
1171
+ 68
1172
+ ],
1173
+ [
1174
+ 8,
1175
+ 90,
1176
+ 2
1177
+ ],
1178
+ [
1179
+ 90,
1180
+ 78,
1181
+ 78
1182
+ ],
1183
+ [
1184
+ 82,
1185
+ 15,
1186
+ 2
1187
+ ],
1188
+ [
1189
+ 18,
1190
+ 34,
1191
+ 12
1192
+ ],
1193
+ [
1194
+ 20,
1195
+ 91,
1196
+ 13
1197
+ ],
1198
+ [
1199
+ 1,
1200
+ 98,
1201
+ 1
1202
+ ],
1203
+ [
1204
+ 4,
1205
+ 82,
1206
+ 3
1207
+ ],
1208
+ [
1209
+ 74,
1210
+ 31,
1211
+ 7
1212
+ ],
1213
+ [
1214
+ 1,
1215
+ 99,
1216
+ 1
1217
+ ],
1218
+ [
1219
+ 28,
1220
+ 98,
1221
+ 17
1222
+ ],
1223
+ [
1224
+ 19,
1225
+ 91,
1226
+ 11
1227
+ ],
1228
+ [
1229
+ 55,
1230
+ 89,
1231
+ 39
1232
+ ],
1233
+ [
1234
+ 34,
1235
+ 80,
1236
+ 3
1237
+ ],
1238
+ [
1239
+ 52,
1240
+ 62,
1241
+ 47
1242
+ ],
1243
+ [
1244
+ 64,
1245
+ 74,
1246
+ 11
1247
+ ],
1248
+ [
1249
+ 14,
1250
+ 25,
1251
+ 4
1252
+ ],
1253
+ [
1254
+ 56,
1255
+ 72,
1256
+ 8
1257
+ ],
1258
+ [
1259
+ 4,
1260
+ 2,
1261
+ 1
1262
+ ],
1263
+ [
1264
+ 18,
1265
+ 12,
1266
+ 11
1267
+ ],
1268
+ [
1269
+ 23,
1270
+ 43,
1271
+ 7
1272
+ ],
1273
+ [
1274
+ 85,
1275
+ 69,
1276
+ 69
1277
+ ],
1278
+ [
1279
+ 13,
1280
+ 99,
1281
+ 12
1282
+ ],
1283
+ [
1284
+ 32,
1285
+ 85,
1286
+ 1
1287
+ ],
1288
+ [
1289
+ 47,
1290
+ 93,
1291
+ 46
1292
+ ],
1293
+ [
1294
+ 70,
1295
+ 80,
1296
+ 31
1297
+ ],
1298
+ [
1299
+ 54,
1300
+ 81,
1301
+ 16
1302
+ ],
1303
+ [
1304
+ 7,
1305
+ 88,
1306
+ 2
1307
+ ],
1308
+ [
1309
+ 66,
1310
+ 59,
1311
+ 49
1312
+ ],
1313
+ [
1314
+ 65,
1315
+ 96,
1316
+ 16
1317
+ ],
1318
+ [
1319
+ 37,
1320
+ 11,
1321
+ 6
1322
+ ],
1323
+ [
1324
+ 33,
1325
+ 58,
1326
+ 3
1327
+ ],
1328
+ [
1329
+ 65,
1330
+ 59,
1331
+ 54
1332
+ ],
1333
+ [
1334
+ 53,
1335
+ 68,
1336
+ 36
1337
+ ],
1338
+ [
1339
+ 29,
1340
+ 21,
1341
+ 17
1342
+ ],
1343
+ [
1344
+ 53,
1345
+ 3,
1346
+ 1
1347
+ ],
1348
+ [
1349
+ 50,
1350
+ 67,
1351
+ 8
1352
+ ],
1353
+ [
1354
+ 49,
1355
+ 59,
1356
+ 33
1357
+ ],
1358
+ [
1359
+ 2,
1360
+ 79,
1361
+ 1
1362
+ ],
1363
+ [
1364
+ 79,
1365
+ 18,
1366
+ 12
1367
+ ],
1368
+ [
1369
+ 95,
1370
+ 59,
1371
+ 3
1372
+ ],
1373
+ [
1374
+ 61,
1375
+ 12,
1376
+ 4
1377
+ ],
1378
+ [
1379
+ 68,
1380
+ 40,
1381
+ 7
1382
+ ],
1383
+ [
1384
+ 43,
1385
+ 78,
1386
+ 31
1387
+ ],
1388
+ [
1389
+ 26,
1390
+ 63,
1391
+ 13
1392
+ ],
1393
+ [
1394
+ 26,
1395
+ 65,
1396
+ 18
1397
+ ],
1398
+ [
1399
+ 27,
1400
+ 52,
1401
+ 22
1402
+ ],
1403
+ [
1404
+ 51,
1405
+ 97,
1406
+ 17
1407
+ ],
1408
+ [
1409
+ 99,
1410
+ 2,
1411
+ 2
1412
+ ],
1413
+ [
1414
+ 32,
1415
+ 14,
1416
+ 10
1417
+ ],
1418
+ [
1419
+ 37,
1420
+ 10,
1421
+ 8
1422
+ ],
1423
+ [
1424
+ 42,
1425
+ 60,
1426
+ 42
1427
+ ],
1428
+ [
1429
+ 8,
1430
+ 6,
1431
+ 1
1432
+ ],
1433
+ [
1434
+ 54,
1435
+ 42,
1436
+ 15
1437
+ ],
1438
+ [
1439
+ 16,
1440
+ 59,
1441
+ 11
1442
+ ]
1443
+ ],
1444
+ "output": 22509
1445
+ },
1446
+ {
1447
+ "input": [
1448
+ [
1449
+ 83,
1450
+ 22,
1451
+ 5
1452
+ ],
1453
+ [
1454
+ 9,
1455
+ 35,
1456
+ 9
1457
+ ],
1458
+ [
1459
+ 61,
1460
+ 79,
1461
+ 56
1462
+ ],
1463
+ [
1464
+ 72,
1465
+ 98,
1466
+ 69
1467
+ ],
1468
+ [
1469
+ 81,
1470
+ 99,
1471
+ 49
1472
+ ],
1473
+ [
1474
+ 40,
1475
+ 42,
1476
+ 2
1477
+ ],
1478
+ [
1479
+ 10,
1480
+ 41,
1481
+ 7
1482
+ ],
1483
+ [
1484
+ 25,
1485
+ 32,
1486
+ 8
1487
+ ],
1488
+ [
1489
+ 2,
1490
+ 50,
1491
+ 1
1492
+ ],
1493
+ [
1494
+ 12,
1495
+ 60,
1496
+ 7
1497
+ ],
1498
+ [
1499
+ 17,
1500
+ 65,
1501
+ 7
1502
+ ],
1503
+ [
1504
+ 30,
1505
+ 22,
1506
+ 6
1507
+ ],
1508
+ [
1509
+ 92,
1510
+ 29,
1511
+ 15
1512
+ ],
1513
+ [
1514
+ 20,
1515
+ 36,
1516
+ 9
1517
+ ],
1518
+ [
1519
+ 24,
1520
+ 60,
1521
+ 21
1522
+ ],
1523
+ [
1524
+ 43,
1525
+ 18,
1526
+ 11
1527
+ ],
1528
+ [
1529
+ 10,
1530
+ 84,
1531
+ 7
1532
+ ],
1533
+ [
1534
+ 50,
1535
+ 34,
1536
+ 23
1537
+ ],
1538
+ [
1539
+ 93,
1540
+ 70,
1541
+ 68
1542
+ ],
1543
+ [
1544
+ 61,
1545
+ 90,
1546
+ 42
1547
+ ],
1548
+ [
1549
+ 99,
1550
+ 21,
1551
+ 9
1552
+ ],
1553
+ [
1554
+ 4,
1555
+ 38,
1556
+ 2
1557
+ ],
1558
+ [
1559
+ 96,
1560
+ 37,
1561
+ 35
1562
+ ],
1563
+ [
1564
+ 3,
1565
+ 56,
1566
+ 3
1567
+ ],
1568
+ [
1569
+ 72,
1570
+ 89,
1571
+ 12
1572
+ ],
1573
+ [
1574
+ 79,
1575
+ 55,
1576
+ 29
1577
+ ],
1578
+ [
1579
+ 41,
1580
+ 75,
1581
+ 3
1582
+ ],
1583
+ [
1584
+ 75,
1585
+ 30,
1586
+ 14
1587
+ ],
1588
+ [
1589
+ 92,
1590
+ 68,
1591
+ 37
1592
+ ],
1593
+ [
1594
+ 26,
1595
+ 47,
1596
+ 19
1597
+ ],
1598
+ [
1599
+ 48,
1600
+ 35,
1601
+ 10
1602
+ ],
1603
+ [
1604
+ 87,
1605
+ 48,
1606
+ 1
1607
+ ],
1608
+ [
1609
+ 39,
1610
+ 15,
1611
+ 13
1612
+ ],
1613
+ [
1614
+ 10,
1615
+ 72,
1616
+ 8
1617
+ ],
1618
+ [
1619
+ 30,
1620
+ 69,
1621
+ 3
1622
+ ],
1623
+ [
1624
+ 73,
1625
+ 97,
1626
+ 58
1627
+ ],
1628
+ [
1629
+ 7,
1630
+ 73,
1631
+ 2
1632
+ ],
1633
+ [
1634
+ 56,
1635
+ 15,
1636
+ 11
1637
+ ],
1638
+ [
1639
+ 49,
1640
+ 18,
1641
+ 2
1642
+ ],
1643
+ [
1644
+ 66,
1645
+ 15,
1646
+ 12
1647
+ ],
1648
+ [
1649
+ 100,
1650
+ 54,
1651
+ 30
1652
+ ],
1653
+ [
1654
+ 82,
1655
+ 48,
1656
+ 14
1657
+ ],
1658
+ [
1659
+ 73,
1660
+ 66,
1661
+ 31
1662
+ ],
1663
+ [
1664
+ 25,
1665
+ 20,
1666
+ 15
1667
+ ],
1668
+ [
1669
+ 80,
1670
+ 87,
1671
+ 33
1672
+ ],
1673
+ [
1674
+ 70,
1675
+ 53,
1676
+ 41
1677
+ ],
1678
+ [
1679
+ 72,
1680
+ 90,
1681
+ 54
1682
+ ],
1683
+ [
1684
+ 1,
1685
+ 85,
1686
+ 1
1687
+ ],
1688
+ [
1689
+ 74,
1690
+ 68,
1691
+ 35
1692
+ ],
1693
+ [
1694
+ 61,
1695
+ 27,
1696
+ 16
1697
+ ]
1698
+ ],
1699
+ "output": 21406
1700
+ },
1701
+ {
1702
+ "input": [
1703
+ [
1704
+ 85,
1705
+ 73,
1706
+ 48
1707
+ ],
1708
+ [
1709
+ 43,
1710
+ 38,
1711
+ 5
1712
+ ],
1713
+ [
1714
+ 35,
1715
+ 51,
1716
+ 28
1717
+ ],
1718
+ [
1719
+ 37,
1720
+ 38,
1721
+ 32
1722
+ ],
1723
+ [
1724
+ 68,
1725
+ 58,
1726
+ 6
1727
+ ],
1728
+ [
1729
+ 44,
1730
+ 61,
1731
+ 5
1732
+ ],
1733
+ [
1734
+ 9,
1735
+ 89,
1736
+ 7
1737
+ ],
1738
+ [
1739
+ 73,
1740
+ 60,
1741
+ 46
1742
+ ],
1743
+ [
1744
+ 35,
1745
+ 16,
1746
+ 15
1747
+ ],
1748
+ [
1749
+ 29,
1750
+ 96,
1751
+ 19
1752
+ ],
1753
+ [
1754
+ 97,
1755
+ 89,
1756
+ 57
1757
+ ],
1758
+ [
1759
+ 44,
1760
+ 89,
1761
+ 29
1762
+ ],
1763
+ [
1764
+ 56,
1765
+ 32,
1766
+ 2
1767
+ ],
1768
+ [
1769
+ 45,
1770
+ 3,
1771
+ 2
1772
+ ],
1773
+ [
1774
+ 99,
1775
+ 20,
1776
+ 9
1777
+ ],
1778
+ [
1779
+ 100,
1780
+ 80,
1781
+ 24
1782
+ ],
1783
+ [
1784
+ 36,
1785
+ 9,
1786
+ 1
1787
+ ],
1788
+ [
1789
+ 14,
1790
+ 90,
1791
+ 12
1792
+ ],
1793
+ [
1794
+ 47,
1795
+ 79,
1796
+ 13
1797
+ ],
1798
+ [
1799
+ 68,
1800
+ 58,
1801
+ 20
1802
+ ],
1803
+ [
1804
+ 20,
1805
+ 68,
1806
+ 20
1807
+ ],
1808
+ [
1809
+ 97,
1810
+ 54,
1811
+ 29
1812
+ ],
1813
+ [
1814
+ 22,
1815
+ 30,
1816
+ 8
1817
+ ],
1818
+ [
1819
+ 66,
1820
+ 23,
1821
+ 22
1822
+ ],
1823
+ [
1824
+ 89,
1825
+ 66,
1826
+ 15
1827
+ ],
1828
+ [
1829
+ 76,
1830
+ 94,
1831
+ 57
1832
+ ],
1833
+ [
1834
+ 35,
1835
+ 26,
1836
+ 22
1837
+ ],
1838
+ [
1839
+ 25,
1840
+ 89,
1841
+ 1
1842
+ ],
1843
+ [
1844
+ 83,
1845
+ 71,
1846
+ 61
1847
+ ],
1848
+ [
1849
+ 26,
1850
+ 25,
1851
+ 14
1852
+ ],
1853
+ [
1854
+ 15,
1855
+ 62,
1856
+ 5
1857
+ ],
1858
+ [
1859
+ 58,
1860
+ 77,
1861
+ 45
1862
+ ],
1863
+ [
1864
+ 90,
1865
+ 30,
1866
+ 21
1867
+ ],
1868
+ [
1869
+ 84,
1870
+ 100,
1871
+ 79
1872
+ ],
1873
+ [
1874
+ 14,
1875
+ 93,
1876
+ 12
1877
+ ],
1878
+ [
1879
+ 96,
1880
+ 96,
1881
+ 88
1882
+ ],
1883
+ [
1884
+ 2,
1885
+ 63,
1886
+ 2
1887
+ ],
1888
+ [
1889
+ 1,
1890
+ 94,
1891
+ 1
1892
+ ],
1893
+ [
1894
+ 42,
1895
+ 100,
1896
+ 18
1897
+ ],
1898
+ [
1899
+ 38,
1900
+ 40,
1901
+ 2
1902
+ ],
1903
+ [
1904
+ 77,
1905
+ 43,
1906
+ 15
1907
+ ],
1908
+ [
1909
+ 48,
1910
+ 38,
1911
+ 25
1912
+ ],
1913
+ [
1914
+ 8,
1915
+ 6,
1916
+ 4
1917
+ ],
1918
+ [
1919
+ 5,
1920
+ 22,
1921
+ 1
1922
+ ],
1923
+ [
1924
+ 38,
1925
+ 79,
1926
+ 15
1927
+ ],
1928
+ [
1929
+ 44,
1930
+ 15,
1931
+ 8
1932
+ ],
1933
+ [
1934
+ 20,
1935
+ 14,
1936
+ 9
1937
+ ],
1938
+ [
1939
+ 9,
1940
+ 28,
1941
+ 4
1942
+ ],
1943
+ [
1944
+ 91,
1945
+ 60,
1946
+ 51
1947
+ ],
1948
+ [
1949
+ 85,
1950
+ 3,
1951
+ 1
1952
+ ],
1953
+ [
1954
+ 43,
1955
+ 98,
1956
+ 21
1957
+ ],
1958
+ [
1959
+ 7,
1960
+ 37,
1961
+ 7
1962
+ ],
1963
+ [
1964
+ 42,
1965
+ 57,
1966
+ 36
1967
+ ],
1968
+ [
1969
+ 22,
1970
+ 87,
1971
+ 6
1972
+ ],
1973
+ [
1974
+ 70,
1975
+ 89,
1976
+ 16
1977
+ ],
1978
+ [
1979
+ 98,
1980
+ 61,
1981
+ 3
1982
+ ],
1983
+ [
1984
+ 11,
1985
+ 22,
1986
+ 10
1987
+ ],
1988
+ [
1989
+ 8,
1990
+ 23,
1991
+ 8
1992
+ ],
1993
+ [
1994
+ 14,
1995
+ 40,
1996
+ 4
1997
+ ],
1998
+ [
1999
+ 51,
2000
+ 48,
2001
+ 19
2002
+ ],
2003
+ [
2004
+ 80,
2005
+ 76,
2006
+ 31
2007
+ ],
2008
+ [
2009
+ 52,
2010
+ 99,
2011
+ 6
2012
+ ],
2013
+ [
2014
+ 53,
2015
+ 98,
2016
+ 49
2017
+ ],
2018
+ [
2019
+ 14,
2020
+ 24,
2021
+ 14
2022
+ ],
2023
+ [
2024
+ 61,
2025
+ 18,
2026
+ 12
2027
+ ],
2028
+ [
2029
+ 86,
2030
+ 12,
2031
+ 12
2032
+ ],
2033
+ [
2034
+ 92,
2035
+ 63,
2036
+ 18
2037
+ ],
2038
+ [
2039
+ 19,
2040
+ 79,
2041
+ 5
2042
+ ],
2043
+ [
2044
+ 85,
2045
+ 23,
2046
+ 11
2047
+ ],
2048
+ [
2049
+ 8,
2050
+ 12,
2051
+ 3
2052
+ ],
2053
+ [
2054
+ 12,
2055
+ 93,
2056
+ 5
2057
+ ],
2058
+ [
2059
+ 78,
2060
+ 58,
2061
+ 23
2062
+ ],
2063
+ [
2064
+ 98,
2065
+ 4,
2066
+ 1
2067
+ ],
2068
+ [
2069
+ 62,
2070
+ 90,
2071
+ 53
2072
+ ],
2073
+ [
2074
+ 92,
2075
+ 44,
2076
+ 7
2077
+ ],
2078
+ [
2079
+ 86,
2080
+ 97,
2081
+ 69
2082
+ ],
2083
+ [
2084
+ 22,
2085
+ 52,
2086
+ 11
2087
+ ],
2088
+ [
2089
+ 59,
2090
+ 32,
2091
+ 6
2092
+ ],
2093
+ [
2094
+ 36,
2095
+ 71,
2096
+ 8
2097
+ ],
2098
+ [
2099
+ 70,
2100
+ 78,
2101
+ 42
2102
+ ],
2103
+ [
2104
+ 99,
2105
+ 65,
2106
+ 33
2107
+ ],
2108
+ [
2109
+ 64,
2110
+ 69,
2111
+ 18
2112
+ ],
2113
+ [
2114
+ 39,
2115
+ 24,
2116
+ 14
2117
+ ],
2118
+ [
2119
+ 62,
2120
+ 11,
2121
+ 2
2122
+ ],
2123
+ [
2124
+ 44,
2125
+ 94,
2126
+ 42
2127
+ ],
2128
+ [
2129
+ 30,
2130
+ 95,
2131
+ 10
2132
+ ],
2133
+ [
2134
+ 57,
2135
+ 46,
2136
+ 23
2137
+ ],
2138
+ [
2139
+ 73,
2140
+ 40,
2141
+ 2
2142
+ ],
2143
+ [
2144
+ 97,
2145
+ 96,
2146
+ 53
2147
+ ],
2148
+ [
2149
+ 70,
2150
+ 81,
2151
+ 17
2152
+ ],
2153
+ [
2154
+ 10,
2155
+ 20,
2156
+ 1
2157
+ ],
2158
+ [
2159
+ 99,
2160
+ 24,
2161
+ 20
2162
+ ],
2163
+ [
2164
+ 84,
2165
+ 97,
2166
+ 31
2167
+ ],
2168
+ [
2169
+ 24,
2170
+ 43,
2171
+ 23
2172
+ ],
2173
+ [
2174
+ 35,
2175
+ 31,
2176
+ 13
2177
+ ],
2178
+ [
2179
+ 79,
2180
+ 55,
2181
+ 15
2182
+ ],
2183
+ [
2184
+ 10,
2185
+ 3,
2186
+ 2
2187
+ ],
2188
+ [
2189
+ 77,
2190
+ 53,
2191
+ 48
2192
+ ],
2193
+ [
2194
+ 30,
2195
+ 35,
2196
+ 1
2197
+ ],
2198
+ [
2199
+ 66,
2200
+ 27,
2201
+ 14
2202
+ ],
2203
+ [
2204
+ 54,
2205
+ 90,
2206
+ 49
2207
+ ],
2208
+ [
2209
+ 56,
2210
+ 74,
2211
+ 25
2212
+ ],
2213
+ [
2214
+ 79,
2215
+ 97,
2216
+ 76
2217
+ ],
2218
+ [
2219
+ 11,
2220
+ 66,
2221
+ 11
2222
+ ],
2223
+ [
2224
+ 11,
2225
+ 53,
2226
+ 8
2227
+ ],
2228
+ [
2229
+ 42,
2230
+ 56,
2231
+ 32
2232
+ ],
2233
+ [
2234
+ 10,
2235
+ 10,
2236
+ 5
2237
+ ],
2238
+ [
2239
+ 51,
2240
+ 70,
2241
+ 43
2242
+ ],
2243
+ [
2244
+ 89,
2245
+ 44,
2246
+ 27
2247
+ ],
2248
+ [
2249
+ 1,
2250
+ 57,
2251
+ 1
2252
+ ],
2253
+ [
2254
+ 21,
2255
+ 56,
2256
+ 8
2257
+ ],
2258
+ [
2259
+ 92,
2260
+ 30,
2261
+ 15
2262
+ ],
2263
+ [
2264
+ 24,
2265
+ 97,
2266
+ 5
2267
+ ],
2268
+ [
2269
+ 86,
2270
+ 45,
2271
+ 28
2272
+ ],
2273
+ [
2274
+ 76,
2275
+ 7,
2276
+ 5
2277
+ ],
2278
+ [
2279
+ 62,
2280
+ 80,
2281
+ 35
2282
+ ],
2283
+ [
2284
+ 8,
2285
+ 30,
2286
+ 4
2287
+ ],
2288
+ [
2289
+ 23,
2290
+ 73,
2291
+ 21
2292
+ ],
2293
+ [
2294
+ 40,
2295
+ 40,
2296
+ 12
2297
+ ],
2298
+ [
2299
+ 70,
2300
+ 66,
2301
+ 8
2302
+ ],
2303
+ [
2304
+ 14,
2305
+ 13,
2306
+ 1
2307
+ ],
2308
+ [
2309
+ 28,
2310
+ 12,
2311
+ 5
2312
+ ],
2313
+ [
2314
+ 30,
2315
+ 64,
2316
+ 9
2317
+ ],
2318
+ [
2319
+ 45,
2320
+ 100,
2321
+ 18
2322
+ ],
2323
+ [
2324
+ 78,
2325
+ 83,
2326
+ 42
2327
+ ],
2328
+ [
2329
+ 26,
2330
+ 88,
2331
+ 4
2332
+ ],
2333
+ [
2334
+ 25,
2335
+ 70,
2336
+ 7
2337
+ ],
2338
+ [
2339
+ 77,
2340
+ 54,
2341
+ 5
2342
+ ],
2343
+ [
2344
+ 62,
2345
+ 71,
2346
+ 61
2347
+ ],
2348
+ [
2349
+ 5,
2350
+ 25,
2351
+ 3
2352
+ ],
2353
+ [
2354
+ 82,
2355
+ 17,
2356
+ 13
2357
+ ],
2358
+ [
2359
+ 15,
2360
+ 75,
2361
+ 11
2362
+ ]
2363
+ ],
2364
+ "output": 27390
2365
+ },
2366
+ {
2367
+ "input": [
2368
+ [
2369
+ 82,
2370
+ 71,
2371
+ 52
2372
+ ],
2373
+ [
2374
+ 82,
2375
+ 87,
2376
+ 61
2377
+ ],
2378
+ [
2379
+ 77,
2380
+ 22,
2381
+ 22
2382
+ ],
2383
+ [
2384
+ 16,
2385
+ 57,
2386
+ 3
2387
+ ],
2388
+ [
2389
+ 50,
2390
+ 86,
2391
+ 7
2392
+ ],
2393
+ [
2394
+ 77,
2395
+ 46,
2396
+ 25
2397
+ ],
2398
+ [
2399
+ 99,
2400
+ 90,
2401
+ 53
2402
+ ],
2403
+ [
2404
+ 35,
2405
+ 28,
2406
+ 2
2407
+ ],
2408
+ [
2409
+ 83,
2410
+ 90,
2411
+ 19
2412
+ ],
2413
+ [
2414
+ 74,
2415
+ 44,
2416
+ 43
2417
+ ],
2418
+ [
2419
+ 54,
2420
+ 39,
2421
+ 26
2422
+ ],
2423
+ [
2424
+ 60,
2425
+ 1,
2426
+ 1
2427
+ ],
2428
+ [
2429
+ 77,
2430
+ 64,
2431
+ 56
2432
+ ],
2433
+ [
2434
+ 35,
2435
+ 39,
2436
+ 35
2437
+ ],
2438
+ [
2439
+ 53,
2440
+ 68,
2441
+ 23
2442
+ ],
2443
+ [
2444
+ 2,
2445
+ 15,
2446
+ 1
2447
+ ],
2448
+ [
2449
+ 8,
2450
+ 54,
2451
+ 6
2452
+ ],
2453
+ [
2454
+ 98,
2455
+ 46,
2456
+ 43
2457
+ ],
2458
+ [
2459
+ 12,
2460
+ 33,
2461
+ 8
2462
+ ],
2463
+ [
2464
+ 3,
2465
+ 62,
2466
+ 2
2467
+ ],
2468
+ [
2469
+ 99,
2470
+ 44,
2471
+ 41
2472
+ ],
2473
+ [
2474
+ 98,
2475
+ 88,
2476
+ 40
2477
+ ],
2478
+ [
2479
+ 100,
2480
+ 50,
2481
+ 41
2482
+ ],
2483
+ [
2484
+ 39,
2485
+ 3,
2486
+ 2
2487
+ ],
2488
+ [
2489
+ 16,
2490
+ 88,
2491
+ 3
2492
+ ],
2493
+ [
2494
+ 98,
2495
+ 26,
2496
+ 12
2497
+ ],
2498
+ [
2499
+ 14,
2500
+ 39,
2501
+ 7
2502
+ ],
2503
+ [
2504
+ 45,
2505
+ 59,
2506
+ 2
2507
+ ],
2508
+ [
2509
+ 53,
2510
+ 92,
2511
+ 37
2512
+ ],
2513
+ [
2514
+ 81,
2515
+ 25,
2516
+ 6
2517
+ ],
2518
+ [
2519
+ 92,
2520
+ 18,
2521
+ 10
2522
+ ],
2523
+ [
2524
+ 80,
2525
+ 93,
2526
+ 78
2527
+ ],
2528
+ [
2529
+ 90,
2530
+ 24,
2531
+ 22
2532
+ ],
2533
+ [
2534
+ 4,
2535
+ 29,
2536
+ 4
2537
+ ],
2538
+ [
2539
+ 74,
2540
+ 83,
2541
+ 73
2542
+ ],
2543
+ [
2544
+ 48,
2545
+ 4,
2546
+ 3
2547
+ ],
2548
+ [
2549
+ 56,
2550
+ 72,
2551
+ 5
2552
+ ],
2553
+ [
2554
+ 16,
2555
+ 13,
2556
+ 1
2557
+ ],
2558
+ [
2559
+ 16,
2560
+ 24,
2561
+ 8
2562
+ ],
2563
+ [
2564
+ 46,
2565
+ 43,
2566
+ 35
2567
+ ],
2568
+ [
2569
+ 90,
2570
+ 80,
2571
+ 3
2572
+ ],
2573
+ [
2574
+ 86,
2575
+ 18,
2576
+ 6
2577
+ ],
2578
+ [
2579
+ 28,
2580
+ 49,
2581
+ 24
2582
+ ],
2583
+ [
2584
+ 61,
2585
+ 34,
2586
+ 11
2587
+ ],
2588
+ [
2589
+ 83,
2590
+ 55,
2591
+ 25
2592
+ ],
2593
+ [
2594
+ 48,
2595
+ 89,
2596
+ 33
2597
+ ],
2598
+ [
2599
+ 22,
2600
+ 37,
2601
+ 20
2602
+ ],
2603
+ [
2604
+ 7,
2605
+ 6,
2606
+ 5
2607
+ ],
2608
+ [
2609
+ 85,
2610
+ 29,
2611
+ 5
2612
+ ],
2613
+ [
2614
+ 17,
2615
+ 28,
2616
+ 15
2617
+ ],
2618
+ [
2619
+ 37,
2620
+ 55,
2621
+ 21
2622
+ ],
2623
+ [
2624
+ 1,
2625
+ 89,
2626
+ 1
2627
+ ],
2628
+ [
2629
+ 38,
2630
+ 90,
2631
+ 28
2632
+ ],
2633
+ [
2634
+ 41,
2635
+ 7,
2636
+ 2
2637
+ ],
2638
+ [
2639
+ 7,
2640
+ 6,
2641
+ 5
2642
+ ],
2643
+ [
2644
+ 69,
2645
+ 10,
2646
+ 2
2647
+ ],
2648
+ [
2649
+ 59,
2650
+ 2,
2651
+ 1
2652
+ ],
2653
+ [
2654
+ 76,
2655
+ 43,
2656
+ 21
2657
+ ],
2658
+ [
2659
+ 53,
2660
+ 52,
2661
+ 29
2662
+ ],
2663
+ [
2664
+ 42,
2665
+ 26,
2666
+ 24
2667
+ ],
2668
+ [
2669
+ 12,
2670
+ 38,
2671
+ 12
2672
+ ],
2673
+ [
2674
+ 52,
2675
+ 28,
2676
+ 6
2677
+ ],
2678
+ [
2679
+ 50,
2680
+ 76,
2681
+ 46
2682
+ ],
2683
+ [
2684
+ 27,
2685
+ 56,
2686
+ 23
2687
+ ],
2688
+ [
2689
+ 32,
2690
+ 69,
2691
+ 25
2692
+ ],
2693
+ [
2694
+ 89,
2695
+ 16,
2696
+ 8
2697
+ ],
2698
+ [
2699
+ 1,
2700
+ 50,
2701
+ 1
2702
+ ],
2703
+ [
2704
+ 31,
2705
+ 34,
2706
+ 29
2707
+ ],
2708
+ [
2709
+ 21,
2710
+ 3,
2711
+ 1
2712
+ ],
2713
+ [
2714
+ 67,
2715
+ 71,
2716
+ 7
2717
+ ],
2718
+ [
2719
+ 40,
2720
+ 86,
2721
+ 11
2722
+ ],
2723
+ [
2724
+ 24,
2725
+ 74,
2726
+ 24
2727
+ ],
2728
+ [
2729
+ 1,
2730
+ 73,
2731
+ 1
2732
+ ],
2733
+ [
2734
+ 87,
2735
+ 83,
2736
+ 58
2737
+ ],
2738
+ [
2739
+ 47,
2740
+ 81,
2741
+ 32
2742
+ ],
2743
+ [
2744
+ 42,
2745
+ 92,
2746
+ 19
2747
+ ],
2748
+ [
2749
+ 29,
2750
+ 25,
2751
+ 24
2752
+ ],
2753
+ [
2754
+ 15,
2755
+ 97,
2756
+ 2
2757
+ ],
2758
+ [
2759
+ 11,
2760
+ 5,
2761
+ 3
2762
+ ],
2763
+ [
2764
+ 16,
2765
+ 57,
2766
+ 12
2767
+ ],
2768
+ [
2769
+ 79,
2770
+ 15,
2771
+ 4
2772
+ ],
2773
+ [
2774
+ 55,
2775
+ 89,
2776
+ 52
2777
+ ],
2778
+ [
2779
+ 1,
2780
+ 84,
2781
+ 1
2782
+ ],
2783
+ [
2784
+ 1,
2785
+ 21,
2786
+ 1
2787
+ ],
2788
+ [
2789
+ 31,
2790
+ 14,
2791
+ 14
2792
+ ],
2793
+ [
2794
+ 82,
2795
+ 45,
2796
+ 9
2797
+ ],
2798
+ [
2799
+ 96,
2800
+ 36,
2801
+ 21
2802
+ ],
2803
+ [
2804
+ 55,
2805
+ 84,
2806
+ 54
2807
+ ],
2808
+ [
2809
+ 64,
2810
+ 95,
2811
+ 64
2812
+ ],
2813
+ [
2814
+ 32,
2815
+ 95,
2816
+ 18
2817
+ ],
2818
+ [
2819
+ 86,
2820
+ 97,
2821
+ 52
2822
+ ],
2823
+ [
2824
+ 69,
2825
+ 36,
2826
+ 22
2827
+ ],
2828
+ [
2829
+ 67,
2830
+ 15,
2831
+ 14
2832
+ ],
2833
+ [
2834
+ 24,
2835
+ 91,
2836
+ 14
2837
+ ],
2838
+ [
2839
+ 47,
2840
+ 10,
2841
+ 1
2842
+ ],
2843
+ [
2844
+ 87,
2845
+ 20,
2846
+ 7
2847
+ ],
2848
+ [
2849
+ 2,
2850
+ 91,
2851
+ 1
2852
+ ],
2853
+ [
2854
+ 67,
2855
+ 65,
2856
+ 12
2857
+ ],
2858
+ [
2859
+ 90,
2860
+ 40,
2861
+ 8
2862
+ ],
2863
+ [
2864
+ 31,
2865
+ 14,
2866
+ 14
2867
+ ],
2868
+ [
2869
+ 16,
2870
+ 24,
2871
+ 3
2872
+ ],
2873
+ [
2874
+ 80,
2875
+ 34,
2876
+ 29
2877
+ ],
2878
+ [
2879
+ 67,
2880
+ 25,
2881
+ 4
2882
+ ],
2883
+ [
2884
+ 57,
2885
+ 94,
2886
+ 33
2887
+ ],
2888
+ [
2889
+ 8,
2890
+ 31,
2891
+ 7
2892
+ ],
2893
+ [
2894
+ 35,
2895
+ 12,
2896
+ 5
2897
+ ],
2898
+ [
2899
+ 65,
2900
+ 69,
2901
+ 49
2902
+ ],
2903
+ [
2904
+ 92,
2905
+ 12,
2906
+ 2
2907
+ ],
2908
+ [
2909
+ 46,
2910
+ 67,
2911
+ 1
2912
+ ],
2913
+ [
2914
+ 35,
2915
+ 73,
2916
+ 11
2917
+ ],
2918
+ [
2919
+ 62,
2920
+ 44,
2921
+ 28
2922
+ ],
2923
+ [
2924
+ 86,
2925
+ 83,
2926
+ 15
2927
+ ],
2928
+ [
2929
+ 54,
2930
+ 42,
2931
+ 21
2932
+ ],
2933
+ [
2934
+ 26,
2935
+ 59,
2936
+ 2
2937
+ ],
2938
+ [
2939
+ 67,
2940
+ 44,
2941
+ 13
2942
+ ],
2943
+ [
2944
+ 3,
2945
+ 54,
2946
+ 2
2947
+ ],
2948
+ [
2949
+ 84,
2950
+ 24,
2951
+ 5
2952
+ ],
2953
+ [
2954
+ 42,
2955
+ 31,
2956
+ 30
2957
+ ],
2958
+ [
2959
+ 42,
2960
+ 6,
2961
+ 2
2962
+ ],
2963
+ [
2964
+ 66,
2965
+ 78,
2966
+ 65
2967
+ ],
2968
+ [
2969
+ 25,
2970
+ 15,
2971
+ 7
2972
+ ],
2973
+ [
2974
+ 9,
2975
+ 31,
2976
+ 7
2977
+ ],
2978
+ [
2979
+ 24,
2980
+ 84,
2981
+ 14
2982
+ ],
2983
+ [
2984
+ 12,
2985
+ 21,
2986
+ 9
2987
+ ],
2988
+ [
2989
+ 38,
2990
+ 65,
2991
+ 16
2992
+ ],
2993
+ [
2994
+ 7,
2995
+ 82,
2996
+ 6
2997
+ ],
2998
+ [
2999
+ 18,
3000
+ 22,
3001
+ 18
3002
+ ],
3003
+ [
3004
+ 39,
3005
+ 81,
3006
+ 38
3007
+ ],
3008
+ [
3009
+ 48,
3010
+ 2,
3011
+ 1
3012
+ ],
3013
+ [
3014
+ 48,
3015
+ 97,
3016
+ 30
3017
+ ],
3018
+ [
3019
+ 92,
3020
+ 38,
3021
+ 26
3022
+ ],
3023
+ [
3024
+ 56,
3025
+ 83,
3026
+ 36
3027
+ ],
3028
+ [
3029
+ 19,
3030
+ 49,
3031
+ 13
3032
+ ],
3033
+ [
3034
+ 8,
3035
+ 42,
3036
+ 3
3037
+ ],
3038
+ [
3039
+ 88,
3040
+ 51,
3041
+ 29
3042
+ ],
3043
+ [
3044
+ 17,
3045
+ 15,
3046
+ 5
3047
+ ],
3048
+ [
3049
+ 100,
3050
+ 59,
3051
+ 55
3052
+ ],
3053
+ [
3054
+ 83,
3055
+ 53,
3056
+ 35
3057
+ ],
3058
+ [
3059
+ 84,
3060
+ 64,
3061
+ 28
3062
+ ],
3063
+ [
3064
+ 94,
3065
+ 32,
3066
+ 31
3067
+ ],
3068
+ [
3069
+ 21,
3070
+ 63,
3071
+ 7
3072
+ ],
3073
+ [
3074
+ 38,
3075
+ 39,
3076
+ 21
3077
+ ],
3078
+ [
3079
+ 33,
3080
+ 26,
3081
+ 6
3082
+ ],
3083
+ [
3084
+ 56,
3085
+ 38,
3086
+ 37
3087
+ ],
3088
+ [
3089
+ 97,
3090
+ 54,
3091
+ 19
3092
+ ],
3093
+ [
3094
+ 47,
3095
+ 91,
3096
+ 24
3097
+ ],
3098
+ [
3099
+ 88,
3100
+ 10,
3101
+ 2
3102
+ ],
3103
+ [
3104
+ 18,
3105
+ 1,
3106
+ 1
3107
+ ],
3108
+ [
3109
+ 43,
3110
+ 4,
3111
+ 2
3112
+ ],
3113
+ [
3114
+ 58,
3115
+ 10,
3116
+ 10
3117
+ ],
3118
+ [
3119
+ 5,
3120
+ 38,
3121
+ 4
3122
+ ],
3123
+ [
3124
+ 39,
3125
+ 32,
3126
+ 18
3127
+ ],
3128
+ [
3129
+ 82,
3130
+ 60,
3131
+ 48
3132
+ ],
3133
+ [
3134
+ 56,
3135
+ 47,
3136
+ 11
3137
+ ],
3138
+ [
3139
+ 69,
3140
+ 91,
3141
+ 3
3142
+ ],
3143
+ [
3144
+ 73,
3145
+ 42,
3146
+ 2
3147
+ ],
3148
+ [
3149
+ 30,
3150
+ 88,
3151
+ 15
3152
+ ],
3153
+ [
3154
+ 8,
3155
+ 82,
3156
+ 2
3157
+ ],
3158
+ [
3159
+ 21,
3160
+ 80,
3161
+ 4
3162
+ ],
3163
+ [
3164
+ 8,
3165
+ 79,
3166
+ 4
3167
+ ],
3168
+ [
3169
+ 2,
3170
+ 41,
3171
+ 2
3172
+ ],
3173
+ [
3174
+ 1,
3175
+ 62,
3176
+ 1
3177
+ ],
3178
+ [
3179
+ 55,
3180
+ 17,
3181
+ 8
3182
+ ],
3183
+ [
3184
+ 35,
3185
+ 87,
3186
+ 31
3187
+ ],
3188
+ [
3189
+ 55,
3190
+ 1,
3191
+ 1
3192
+ ],
3193
+ [
3194
+ 44,
3195
+ 68,
3196
+ 1
3197
+ ],
3198
+ [
3199
+ 15,
3200
+ 36,
3201
+ 9
3202
+ ],
3203
+ [
3204
+ 79,
3205
+ 84,
3206
+ 52
3207
+ ],
3208
+ [
3209
+ 65,
3210
+ 68,
3211
+ 48
3212
+ ],
3213
+ [
3214
+ 64,
3215
+ 90,
3216
+ 13
3217
+ ],
3218
+ [
3219
+ 32,
3220
+ 5,
3221
+ 2
3222
+ ],
3223
+ [
3224
+ 98,
3225
+ 63,
3226
+ 5
3227
+ ],
3228
+ [
3229
+ 94,
3230
+ 1,
3231
+ 1
3232
+ ],
3233
+ [
3234
+ 18,
3235
+ 16,
3236
+ 10
3237
+ ],
3238
+ [
3239
+ 70,
3240
+ 72,
3241
+ 62
3242
+ ],
3243
+ [
3244
+ 1,
3245
+ 43,
3246
+ 1
3247
+ ],
3248
+ [
3249
+ 13,
3250
+ 90,
3251
+ 6
3252
+ ]
3253
+ ],
3254
+ "output": 23012
3255
+ },
3256
+ {
3257
+ "input": [
3258
+ [
3259
+ 6,
3260
+ 53,
3261
+ 5
3262
+ ],
3263
+ [
3264
+ 39,
3265
+ 92,
3266
+ 18
3267
+ ],
3268
+ [
3269
+ 49,
3270
+ 82,
3271
+ 22
3272
+ ],
3273
+ [
3274
+ 54,
3275
+ 55,
3276
+ 42
3277
+ ],
3278
+ [
3279
+ 73,
3280
+ 73,
3281
+ 34
3282
+ ],
3283
+ [
3284
+ 79,
3285
+ 69,
3286
+ 64
3287
+ ],
3288
+ [
3289
+ 3,
3290
+ 53,
3291
+ 2
3292
+ ],
3293
+ [
3294
+ 43,
3295
+ 15,
3296
+ 12
3297
+ ],
3298
+ [
3299
+ 53,
3300
+ 63,
3301
+ 32
3302
+ ],
3303
+ [
3304
+ 42,
3305
+ 100,
3306
+ 14
3307
+ ],
3308
+ [
3309
+ 93,
3310
+ 98,
3311
+ 32
3312
+ ],
3313
+ [
3314
+ 19,
3315
+ 53,
3316
+ 11
3317
+ ],
3318
+ [
3319
+ 65,
3320
+ 13,
3321
+ 3
3322
+ ],
3323
+ [
3324
+ 100,
3325
+ 7,
3326
+ 2
3327
+ ],
3328
+ [
3329
+ 76,
3330
+ 68,
3331
+ 46
3332
+ ],
3333
+ [
3334
+ 21,
3335
+ 83,
3336
+ 15
3337
+ ],
3338
+ [
3339
+ 30,
3340
+ 70,
3341
+ 12
3342
+ ],
3343
+ [
3344
+ 54,
3345
+ 10,
3346
+ 2
3347
+ ],
3348
+ [
3349
+ 72,
3350
+ 91,
3351
+ 48
3352
+ ],
3353
+ [
3354
+ 3,
3355
+ 83,
3356
+ 2
3357
+ ],
3358
+ [
3359
+ 63,
3360
+ 52,
3361
+ 36
3362
+ ],
3363
+ [
3364
+ 87,
3365
+ 20,
3366
+ 18
3367
+ ],
3368
+ [
3369
+ 7,
3370
+ 25,
3371
+ 6
3372
+ ],
3373
+ [
3374
+ 16,
3375
+ 48,
3376
+ 2
3377
+ ],
3378
+ [
3379
+ 15,
3380
+ 27,
3381
+ 8
3382
+ ],
3383
+ [
3384
+ 7,
3385
+ 20,
3386
+ 3
3387
+ ],
3388
+ [
3389
+ 48,
3390
+ 35,
3391
+ 1
3392
+ ],
3393
+ [
3394
+ 50,
3395
+ 46,
3396
+ 24
3397
+ ],
3398
+ [
3399
+ 40,
3400
+ 35,
3401
+ 17
3402
+ ],
3403
+ [
3404
+ 20,
3405
+ 84,
3406
+ 6
3407
+ ],
3408
+ [
3409
+ 48,
3410
+ 58,
3411
+ 32
3412
+ ],
3413
+ [
3414
+ 84,
3415
+ 96,
3416
+ 59
3417
+ ],
3418
+ [
3419
+ 25,
3420
+ 38,
3421
+ 5
3422
+ ],
3423
+ [
3424
+ 7,
3425
+ 30,
3426
+ 5
3427
+ ],
3428
+ [
3429
+ 81,
3430
+ 19,
3431
+ 6
3432
+ ],
3433
+ [
3434
+ 7,
3435
+ 5,
3436
+ 5
3437
+ ],
3438
+ [
3439
+ 14,
3440
+ 91,
3441
+ 11
3442
+ ],
3443
+ [
3444
+ 65,
3445
+ 66,
3446
+ 46
3447
+ ],
3448
+ [
3449
+ 44,
3450
+ 31,
3451
+ 31
3452
+ ],
3453
+ [
3454
+ 91,
3455
+ 10,
3456
+ 4
3457
+ ],
3458
+ [
3459
+ 12,
3460
+ 78,
3461
+ 10
3462
+ ],
3463
+ [
3464
+ 89,
3465
+ 7,
3466
+ 6
3467
+ ],
3468
+ [
3469
+ 68,
3470
+ 62,
3471
+ 40
3472
+ ],
3473
+ [
3474
+ 7,
3475
+ 34,
3476
+ 7
3477
+ ],
3478
+ [
3479
+ 77,
3480
+ 100,
3481
+ 56
3482
+ ],
3483
+ [
3484
+ 31,
3485
+ 16,
3486
+ 1
3487
+ ],
3488
+ [
3489
+ 39,
3490
+ 75,
3491
+ 22
3492
+ ],
3493
+ [
3494
+ 52,
3495
+ 81,
3496
+ 43
3497
+ ],
3498
+ [
3499
+ 62,
3500
+ 68,
3501
+ 31
3502
+ ],
3503
+ [
3504
+ 18,
3505
+ 59,
3506
+ 14
3507
+ ],
3508
+ [
3509
+ 85,
3510
+ 64,
3511
+ 16
3512
+ ],
3513
+ [
3514
+ 19,
3515
+ 98,
3516
+ 2
3517
+ ]
3518
+ ],
3519
+ "output": 17755
3520
+ },
3521
+ {
3522
+ "input": [
3523
+ [
3524
+ 19,
3525
+ 61,
3526
+ 2
3527
+ ],
3528
+ [
3529
+ 15,
3530
+ 92,
3531
+ 6
3532
+ ],
3533
+ [
3534
+ 52,
3535
+ 77,
3536
+ 43
3537
+ ],
3538
+ [
3539
+ 3,
3540
+ 13,
3541
+ 3
3542
+ ],
3543
+ [
3544
+ 80,
3545
+ 90,
3546
+ 20
3547
+ ],
3548
+ [
3549
+ 21,
3550
+ 12,
3551
+ 2
3552
+ ],
3553
+ [
3554
+ 80,
3555
+ 22,
3556
+ 12
3557
+ ],
3558
+ [
3559
+ 81,
3560
+ 10,
3561
+ 2
3562
+ ],
3563
+ [
3564
+ 28,
3565
+ 97,
3566
+ 8
3567
+ ],
3568
+ [
3569
+ 40,
3570
+ 45,
3571
+ 35
3572
+ ],
3573
+ [
3574
+ 15,
3575
+ 22,
3576
+ 8
3577
+ ],
3578
+ [
3579
+ 86,
3580
+ 58,
3581
+ 24
3582
+ ],
3583
+ [
3584
+ 52,
3585
+ 53,
3586
+ 26
3587
+ ],
3588
+ [
3589
+ 53,
3590
+ 17,
3591
+ 6
3592
+ ],
3593
+ [
3594
+ 41,
3595
+ 50,
3596
+ 36
3597
+ ],
3598
+ [
3599
+ 68,
3600
+ 43,
3601
+ 40
3602
+ ],
3603
+ [
3604
+ 3,
3605
+ 32,
3606
+ 3
3607
+ ],
3608
+ [
3609
+ 87,
3610
+ 42,
3611
+ 3
3612
+ ],
3613
+ [
3614
+ 28,
3615
+ 3,
3616
+ 1
3617
+ ],
3618
+ [
3619
+ 52,
3620
+ 20,
3621
+ 10
3622
+ ],
3623
+ [
3624
+ 96,
3625
+ 51,
3626
+ 2
3627
+ ],
3628
+ [
3629
+ 26,
3630
+ 26,
3631
+ 12
3632
+ ],
3633
+ [
3634
+ 49,
3635
+ 80,
3636
+ 15
3637
+ ],
3638
+ [
3639
+ 82,
3640
+ 57,
3641
+ 11
3642
+ ],
3643
+ [
3644
+ 50,
3645
+ 91,
3646
+ 24
3647
+ ],
3648
+ [
3649
+ 55,
3650
+ 30,
3651
+ 19
3652
+ ],
3653
+ [
3654
+ 63,
3655
+ 94,
3656
+ 33
3657
+ ],
3658
+ [
3659
+ 50,
3660
+ 91,
3661
+ 45
3662
+ ],
3663
+ [
3664
+ 66,
3665
+ 82,
3666
+ 57
3667
+ ],
3668
+ [
3669
+ 8,
3670
+ 55,
3671
+ 2
3672
+ ],
3673
+ [
3674
+ 66,
3675
+ 34,
3676
+ 14
3677
+ ],
3678
+ [
3679
+ 82,
3680
+ 82,
3681
+ 65
3682
+ ],
3683
+ [
3684
+ 58,
3685
+ 25,
3686
+ 19
3687
+ ],
3688
+ [
3689
+ 69,
3690
+ 2,
3691
+ 1
3692
+ ],
3693
+ [
3694
+ 98,
3695
+ 34,
3696
+ 31
3697
+ ],
3698
+ [
3699
+ 31,
3700
+ 69,
3701
+ 4
3702
+ ],
3703
+ [
3704
+ 99,
3705
+ 59,
3706
+ 3
3707
+ ],
3708
+ [
3709
+ 88,
3710
+ 17,
3711
+ 7
3712
+ ],
3713
+ [
3714
+ 78,
3715
+ 59,
3716
+ 47
3717
+ ],
3718
+ [
3719
+ 26,
3720
+ 83,
3721
+ 8
3722
+ ],
3723
+ [
3724
+ 50,
3725
+ 74,
3726
+ 15
3727
+ ],
3728
+ [
3729
+ 41,
3730
+ 88,
3731
+ 21
3732
+ ],
3733
+ [
3734
+ 41,
3735
+ 48,
3736
+ 28
3737
+ ],
3738
+ [
3739
+ 97,
3740
+ 69,
3741
+ 34
3742
+ ],
3743
+ [
3744
+ 81,
3745
+ 96,
3746
+ 71
3747
+ ],
3748
+ [
3749
+ 58,
3750
+ 59,
3751
+ 51
3752
+ ],
3753
+ [
3754
+ 33,
3755
+ 61,
3756
+ 31
3757
+ ],
3758
+ [
3759
+ 69,
3760
+ 25,
3761
+ 22
3762
+ ],
3763
+ [
3764
+ 24,
3765
+ 6,
3766
+ 1
3767
+ ],
3768
+ [
3769
+ 43,
3770
+ 64,
3771
+ 5
3772
+ ],
3773
+ [
3774
+ 95,
3775
+ 25,
3776
+ 18
3777
+ ],
3778
+ [
3779
+ 17,
3780
+ 100,
3781
+ 8
3782
+ ],
3783
+ [
3784
+ 47,
3785
+ 54,
3786
+ 5
3787
+ ],
3788
+ [
3789
+ 23,
3790
+ 42,
3791
+ 19
3792
+ ],
3793
+ [
3794
+ 52,
3795
+ 100,
3796
+ 45
3797
+ ]
3798
+ ],
3799
+ "output": 19823
3800
+ }
3801
+ ],
3802
+ "haskell_template": "countLatticePoints :: [[Int]] -> Int\ncountLatticePoints circles ",
3803
+ "ocaml_template": "let countLatticePoints (circles: int list list) : int = ",
3804
+ "scala_template": "def countLatticePoints(circles: List[List[Int]]): Int = { \n \n}",
3805
+ "java_template": "public static int countLatticePoints(List<List<Integer>> circles) {\n\n}",
3806
+ "python_template": "class Solution(object):\n def countLatticePoints(self, circles):\n \"\"\"\n :type circles: List[List[int]]\n :rtype: int\n \"\"\"\n "
3807
+ }
count_lattice_points_inside_a_circle/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 5 (countLatticePoints [[2;2;1]])
12
+
13
+ let test2 _ = assert_equal 16 (countLatticePoints [[2;2;2];[3;4;1]])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for countLatticePoints" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
count_lattice_points_inside_a_circle/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.countLatticePoints(List(List(2,2,1))), 5)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.countLatticePoints(List(List(2,2,2),List(3,4,1))), 16)
10
+ }
11
+
12
+ }
count_mentions_per_user/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(new ArrayList<>(Arrays.asList(2,2)), countMentions(2, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList("MESSAGE","10","id1 id0")),new ArrayList<>(Arrays.asList("OFFLINE","11","0")),new ArrayList<>(Arrays.asList("MESSAGE","71","HERE"))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(2,2)), countMentions(2, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList("MESSAGE","10","id1 id0")),new ArrayList<>(Arrays.asList("OFFLINE","11","0")),new ArrayList<>(Arrays.asList("MESSAGE","12","ALL"))))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(new ArrayList<>(Arrays.asList(0,1)), countMentions(2, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList("OFFLINE","10","0")),new ArrayList<>(Arrays.asList("MESSAGE","12","HERE"))))));
23
+ }
24
+
25
+ }
count_non_decreasing_subarrays_after_k_operations/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
count_non_decreasing_subarrays_after_k_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(17, countNonDecreasingSubarrays(new ArrayList<>(Arrays.asList(6,3,1,2,4,4)), 7));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(12, countNonDecreasingSubarrays(new ArrayList<>(Arrays.asList(6,3,1,3,6)), 4));
19
+ }
20
+
21
+ }
count_non_decreasing_subarrays_after_k_operations/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0dca6248eb33aeec8802567a28fde72753583d15787f31bce58e1abe486eb28
3
+ size 13975717
count_non_decreasing_subarrays_after_k_operations/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
count_non_decreasing_subarrays_after_k_operations/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
count_number_of_bad_pairs/.DS_Store ADDED
Binary file (6.15 kB). View file
 
count_number_of_bad_pairs/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 (countBadPairs [4,1,3,3])," 5 (countBadPairs [4,1,3,3]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (countBadPairs [1,2,3,4,5])," 0 (countBadPairs [1,2,3,4,5]))
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
count_number_of_bad_pairs/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(5, countBadPairs(new ArrayList<>(Arrays.asList(4,1,3,3))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(0, countBadPairs(new ArrayList<>(Arrays.asList(1,2,3,4,5))));
19
+ }
20
+
21
+ }
count_number_of_bad_pairs/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efe10abb5dae8fa179c3f0b485a3a5a878641cc4bca2ddf505757dabbf60f4d6
3
+ size 13547572
count_number_of_bad_pairs/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 5 (countBadPairs [4;1;3;3])
12
+
13
+ let test2 _ = assert_equal 0 (countBadPairs [1;2;3;4;5])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for countBadPairs" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
count_number_of_bad_pairs/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.countBadPairs(List(4,1,3,3)), 5)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.countBadPairs(List(1,2,3,4,5)), 0)
10
+ }
11
+
12
+ }
count_number_of_distinct_integers_after_reverse_operations/.DS_Store ADDED
Binary file (6.15 kB). View file
 
count_number_of_distinct_integers_after_reverse_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 (countDistinctIntegers [1,13,10,12,31])," 6 (countDistinctIntegers [1,13,10,12,31]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (countDistinctIntegers [2,2,2])," 1 (countDistinctIntegers [2,2,2]))
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
count_number_of_distinct_integers_after_reverse_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(6, countDistinctIntegers(new ArrayList<>(Arrays.asList(1,13,10,12,31))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(1, countDistinctIntegers(new ArrayList<>(Arrays.asList(2,2,2))));
19
+ }
20
+
21
+ }
count_number_of_distinct_integers_after_reverse_operations/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
count_number_of_distinct_integers_after_reverse_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 6 (countDistinctIntegers [1;13;10;12;31])
12
+
13
+ let test2 _ = assert_equal 1 (countDistinctIntegers [2;2;2])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for countDistinctIntegers" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
count_number_of_distinct_integers_after_reverse_operations/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.countDistinctIntegers(List(1,13,10,12,31)), 6)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.countDistinctIntegers(List(2,2,2)), 1)
10
+ }
11
+
12
+ }
count_number_of_possible_root_nodes/.DS_Store ADDED
Binary file (6.15 kB). View file
 
count_number_of_possible_root_nodes/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 (rootCount [[0,1],[1,2],[1,3],[4,2]] [[1,3],[0,1],[1,0],[2,4]] 3)," 3 (rootCount [[0,1],[1,2],[1,3],[4,2]] [[1,3],[0,1],[1,0],[2,4]] 3))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (rootCount [[0,1],[1,2],[2,3],[3,4]] [[1,0],[3,4],[2,1],[3,2]] 1)," 5 (rootCount [[0,1],[1,2],[2,3],[3,4]] [[1,0],[3,4],[2,1],[3,2]] 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
count_number_of_possible_root_nodes/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(3, rootCount(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0,1)),new ArrayList<>(Arrays.asList(1,2)),new ArrayList<>(Arrays.asList(1,3)),new ArrayList<>(Arrays.asList(4,2)))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,3)),new ArrayList<>(Arrays.asList(0,1)),new ArrayList<>(Arrays.asList(1,0)),new ArrayList<>(Arrays.asList(2,4)))), 3));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(5, rootCount(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0,1)),new ArrayList<>(Arrays.asList(1,2)),new ArrayList<>(Arrays.asList(2,3)),new ArrayList<>(Arrays.asList(3,4)))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,0)),new ArrayList<>(Arrays.asList(3,4)),new ArrayList<>(Arrays.asList(2,1)),new ArrayList<>(Arrays.asList(3,2)))), 1));
19
+ }
20
+
21
+ }
count_number_of_possible_root_nodes/meta.json ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2652,
3
+ "name": "count_number_of_possible_root_nodes",
4
+ "difficulty": "Hard",
5
+ "link": "https://leetcode.com/problems/count-number-of-possible-root-nodes/",
6
+ "date": "1676678400000",
7
+ "task_description": "Alice has an undirected tree with `n` nodes labeled from `0` to `n - 1`. The tree is represented as a 2D integer array `edges` of length `n - 1` where `edges[i] = [ai, bi]` indicates that there is an edge between nodes `ai` and `bi` in the tree. Alice wants Bob to find the root of the tree. She allows Bob to make several **guesses** about her tree. In one guess, he does the following: Chooses two **distinct** integers `u` and `v` such that there exists an edge `[u, v]` in the tree. He tells Alice that `u` is the **parent** of `v` in the tree. Bob's guesses are represented by a 2D integer array `guesses` where `guesses[j] = [uj, vj]` indicates Bob guessed `uj` to be the parent of `vj`. Alice being lazy, does not reply to each of Bob's guesses, but just says that **at least** `k` of his guesses are `true`. Given the 2D integer arrays `edges`, `guesses` and the integer `k`, return _the **number of possible nodes** that can be the root of Alice's tree_. If there is no such tree, return `0`. **Example 1:** ``` **Input:** edges = [[0,1],[1,2],[1,3],[4,2]], guesses = [[1,3],[0,1],[1,0],[2,4]], k = 3 **Output:** 3 **Explanation:** Root = 0, correct guesses = [1,3], [0,1], [2,4] Root = 1, correct guesses = [1,3], [1,0], [2,4] Root = 2, correct guesses = [1,3], [1,0], [2,4] Root = 3, correct guesses = [1,0], [2,4] Root = 4, correct guesses = [1,3], [1,0] Considering 0, 1, or 2 as root node leads to 3 correct guesses. ``` **Example 2:** ``` **Input:** edges = [[0,1],[1,2],[2,3],[3,4]], guesses = [[1,0],[3,4],[2,1],[3,2]], k = 1 **Output:** 5 **Explanation:** Root = 0, correct guesses = [3,4] Root = 1, correct guesses = [1,0], [3,4] Root = 2, correct guesses = [1,0], [2,1], [3,4] Root = 3, correct guesses = [1,0], [2,1], [3,2], [3,4] Root = 4, correct guesses = [1,0], [2,1], [3,2] Considering any node as root will give at least 1 correct guess. ``` **Constraints:** `edges.length == n - 1` `2 <= n <= 105` `1 <= guesses.length <= 105` `0 <= ai, bi, uj, vj <= n - 1` `ai != bi` `uj != vj` `edges` represents a valid tree. `guesses[j]` is an edge of the tree. `guesses` is unique. `0 <= k <= guesses.length`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "edges = [[0,1],[1,2],[1,3],[4,2]], guesses = [[1,3],[0,1],[1,0],[2,4]], k = 3",
12
+ "output": "3 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "edges = [[0,1],[1,2],[2,3],[3,4]], guesses = [[1,0],[3,4],[2,1],[3,2]], k = 1",
17
+ "output": "5 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ [
24
+ [
25
+ 0,
26
+ 1
27
+ ],
28
+ [
29
+ 1,
30
+ 2
31
+ ],
32
+ [
33
+ 2,
34
+ 3
35
+ ],
36
+ [
37
+ 3,
38
+ 4
39
+ ],
40
+ [
41
+ 3,
42
+ 5
43
+ ],
44
+ [
45
+ 3,
46
+ 6
47
+ ],
48
+ [
49
+ 2,
50
+ 7
51
+ ]
52
+ ],
53
+ [
54
+ [
55
+ 1,
56
+ 2
57
+ ],
58
+ [
59
+ 3,
60
+ 4
61
+ ],
62
+ [
63
+ 2,
64
+ 3
65
+ ],
66
+ [
67
+ 3,
68
+ 5
69
+ ]
70
+ ],
71
+ 0
72
+ ],
73
+ "output": 8
74
+ },
75
+ {
76
+ "input": [
77
+ [
78
+ [
79
+ 0,
80
+ 1
81
+ ]
82
+ ],
83
+ [
84
+ [
85
+ 0,
86
+ 1
87
+ ]
88
+ ],
89
+ 1
90
+ ],
91
+ "output": 1
92
+ },
93
+ {
94
+ "input": [
95
+ [
96
+ [
97
+ 0,
98
+ 1
99
+ ],
100
+ [
101
+ 1,
102
+ 2
103
+ ],
104
+ [
105
+ 1,
106
+ 3
107
+ ]
108
+ ],
109
+ [
110
+ [
111
+ 0,
112
+ 1
113
+ ],
114
+ [
115
+ 1,
116
+ 2
117
+ ],
118
+ [
119
+ 1,
120
+ 3
121
+ ]
122
+ ],
123
+ 3
124
+ ],
125
+ "output": 1
126
+ },
127
+ {
128
+ "input": [
129
+ [
130
+ [
131
+ 0,
132
+ 1
133
+ ],
134
+ [
135
+ 1,
136
+ 2
137
+ ],
138
+ [
139
+ 1,
140
+ 3
141
+ ],
142
+ [
143
+ 2,
144
+ 4
145
+ ],
146
+ [
147
+ 4,
148
+ 5
149
+ ]
150
+ ],
151
+ [
152
+ [
153
+ 2,
154
+ 4
155
+ ],
156
+ [
157
+ 4,
158
+ 5
159
+ ],
160
+ [
161
+ 1,
162
+ 3
163
+ ],
164
+ [
165
+ 1,
166
+ 2
167
+ ],
168
+ [
169
+ 0,
170
+ 1
171
+ ]
172
+ ],
173
+ 0
174
+ ],
175
+ "output": 6
176
+ },
177
+ {
178
+ "input": [
179
+ [
180
+ [
181
+ 0,
182
+ 1
183
+ ],
184
+ [
185
+ 1,
186
+ 2
187
+ ],
188
+ [
189
+ 1,
190
+ 3
191
+ ],
192
+ [
193
+ 1,
194
+ 4
195
+ ],
196
+ [
197
+ 4,
198
+ 5
199
+ ],
200
+ [
201
+ 5,
202
+ 6
203
+ ],
204
+ [
205
+ 1,
206
+ 7
207
+ ],
208
+ [
209
+ 1,
210
+ 8
211
+ ],
212
+ [
213
+ 6,
214
+ 9
215
+ ]
216
+ ],
217
+ [
218
+ [
219
+ 4,
220
+ 5
221
+ ],
222
+ [
223
+ 1,
224
+ 8
225
+ ],
226
+ [
227
+ 6,
228
+ 9
229
+ ]
230
+ ],
231
+ 3
232
+ ],
233
+ "output": 6
234
+ },
235
+ {
236
+ "input": [
237
+ [
238
+ [
239
+ 0,
240
+ 1
241
+ ],
242
+ [
243
+ 1,
244
+ 2
245
+ ],
246
+ [
247
+ 0,
248
+ 3
249
+ ],
250
+ [
251
+ 1,
252
+ 4
253
+ ],
254
+ [
255
+ 4,
256
+ 5
257
+ ],
258
+ [
259
+ 0,
260
+ 6
261
+ ]
262
+ ],
263
+ [
264
+ [
265
+ 1,
266
+ 4
267
+ ]
268
+ ],
269
+ 1
270
+ ],
271
+ "output": 5
272
+ },
273
+ {
274
+ "input": [
275
+ [
276
+ [
277
+ 0,
278
+ 1
279
+ ]
280
+ ],
281
+ [
282
+ [
283
+ 0,
284
+ 1
285
+ ]
286
+ ],
287
+ 0
288
+ ],
289
+ "output": 2
290
+ },
291
+ {
292
+ "input": [
293
+ [
294
+ [
295
+ 0,
296
+ 1
297
+ ],
298
+ [
299
+ 1,
300
+ 2
301
+ ],
302
+ [
303
+ 2,
304
+ 3
305
+ ],
306
+ [
307
+ 0,
308
+ 4
309
+ ],
310
+ [
311
+ 2,
312
+ 5
313
+ ]
314
+ ],
315
+ [
316
+ [
317
+ 0,
318
+ 1
319
+ ]
320
+ ],
321
+ 1
322
+ ],
323
+ "output": 2
324
+ },
325
+ {
326
+ "input": [
327
+ [
328
+ [
329
+ 0,
330
+ 1
331
+ ],
332
+ [
333
+ 1,
334
+ 2
335
+ ]
336
+ ],
337
+ [
338
+ [
339
+ 0,
340
+ 1
341
+ ]
342
+ ],
343
+ 1
344
+ ],
345
+ "output": 1
346
+ },
347
+ {
348
+ "input": [
349
+ [
350
+ [
351
+ 0,
352
+ 1
353
+ ],
354
+ [
355
+ 1,
356
+ 2
357
+ ]
358
+ ],
359
+ [
360
+ [
361
+ 0,
362
+ 1
363
+ ]
364
+ ],
365
+ 1
366
+ ],
367
+ "output": 1
368
+ }
369
+ ],
370
+ "haskell_template": "rootCount :: [[Int]] -> [[Int]] -> Int -> Int\nrootCount edges guesses k ",
371
+ "ocaml_template": "let rootCount (edges: int list list) (guesses: int list list) (k: int) : int = ",
372
+ "scala_template": "def rootCount(edges: List[List[Int]],guesses: List[List[Int]],k: Int): Int = { \n \n}",
373
+ "java_template": "public static int rootCount(List<List<Integer>> edges, List<List<Integer>> guesses, int k) {\n\n}",
374
+ "python_template": "class Solution(object):\n def rootCount(self, edges, guesses, k):\n \"\"\"\n :type edges: List[List[int]]\n :type guesses: List[List[int]]\n :type k: int\n :rtype: int\n \"\"\"\n "
375
+ }
count_number_of_possible_root_nodes/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 3 (rootCount [[0;1];[1;2];[1;3];[4;2]] [[1;3];[0;1];[1;0];[2;4]] 3)
12
+
13
+ let test2 _ = assert_equal 5 (rootCount [[0;1];[1;2];[2;3];[3;4]] [[1;0];[3;4];[2;1];[3;2]] 1)
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for rootCount" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
count_number_of_possible_root_nodes/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.rootCount(List(List(0,1),List(1,2),List(1,3),List(4,2)),List(List(1,3),List(0,1),List(1,0),List(2,4)),3), 3)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.rootCount(List(List(0,1),List(1,2),List(2,3),List(3,4)),List(List(1,0),List(3,4),List(2,1),List(3,2)),1), 5)
10
+ }
11
+
12
+ }
count_number_of_rectangles_containing_each_point/.DS_Store ADDED
Binary file (6.15 kB). View file