DatasetRepo commited on
Commit
6718cf6
·
verified ·
1 Parent(s): 1529faa

ae9c38edfd8249879219b0098cdc752da888d908e97d9e91b6a515cc5a19fa42

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 +4 -0
  2. odd_string_difference/.DS_Store +0 -0
  3. odd_string_difference/haskell_tests/Main.hs +24 -0
  4. odd_string_difference/java_tests/Main.java +21 -0
  5. odd_string_difference/meta.json +26 -0
  6. odd_string_difference/ocaml_tests/main.ml +26 -0
  7. odd_string_difference/scala_tests/MySuite.scala +12 -0
  8. optimal_partition_of_string/.DS_Store +0 -0
  9. optimal_partition_of_string/haskell_tests/Main.hs +24 -0
  10. optimal_partition_of_string/java_tests/Main.java +21 -0
  11. optimal_partition_of_string/meta.json +0 -0
  12. optimal_partition_of_string/ocaml_tests/main.ml +26 -0
  13. optimal_partition_of_string/scala_tests/MySuite.scala +12 -0
  14. paint_house_iv/haskell_tests/Main.hs +3 -0
  15. paint_house_iv/java_tests/Main.java +21 -0
  16. paint_house_iv/meta.json +3 -0
  17. paint_house_iv/ocaml_tests/main.ml +0 -0
  18. paint_house_iv/scala_tests/MySuite.scala +0 -0
  19. painting_the_walls/haskell_tests/Main.hs +45 -0
  20. painting_the_walls/java_tests/Main.java +21 -0
  21. painting_the_walls/meta.json +0 -0
  22. painting_the_walls/ocaml_tests/main.ml +50 -0
  23. painting_the_walls/scala_tests/MySuite.scala +44 -0
  24. palindrome_rearrangement_queries/java_tests/Main.java +25 -0
  25. partition_array_according_to_given_pivot/.DS_Store +0 -0
  26. partition_array_according_to_given_pivot/haskell_tests/Main.hs +24 -0
  27. partition_array_according_to_given_pivot/java_tests/Main.java +21 -0
  28. partition_array_according_to_given_pivot/meta.json +3 -0
  29. partition_array_according_to_given_pivot/ocaml_tests/main.ml +26 -0
  30. partition_array_according_to_given_pivot/scala_tests/MySuite.scala +12 -0
  31. partition_array_such_that_maximum_difference_is_k/haskell_tests/Main.hs +0 -0
  32. partition_array_such_that_maximum_difference_is_k/java_tests/Main.java +25 -0
  33. partition_array_such_that_maximum_difference_is_k/meta.json +3 -0
  34. partition_array_such_that_maximum_difference_is_k/ocaml_tests/main.ml +0 -0
  35. partition_array_such_that_maximum_difference_is_k/scala_tests/MySuite.scala +0 -0
  36. partition_string_into_minimum_beautiful_substrings/.DS_Store +0 -0
  37. partition_string_into_minimum_beautiful_substrings/haskell_tests/Main.hs +27 -0
  38. partition_string_into_minimum_beautiful_substrings/java_tests/Main.java +25 -0
  39. partition_string_into_minimum_beautiful_substrings/meta.json +72 -0
  40. partition_string_into_minimum_beautiful_substrings/ocaml_tests/main.ml +29 -0
  41. partition_string_into_minimum_beautiful_substrings/scala_tests/MySuite.scala +16 -0
  42. partition_string_into_substrings_with_values_at_most_k/.DS_Store +0 -0
  43. partition_string_into_substrings_with_values_at_most_k/haskell_tests/Main.hs +24 -0
  44. partition_string_into_substrings_with_values_at_most_k/java_tests/Main.java +21 -0
  45. partition_string_into_substrings_with_values_at_most_k/meta.json +0 -0
  46. partition_string_into_substrings_with_values_at_most_k/ocaml_tests/main.ml +26 -0
  47. partition_string_into_substrings_with_values_at_most_k/scala_tests/MySuite.scala +12 -0
  48. pass_the_pillow/haskell_tests/Main.hs +45 -0
  49. pass_the_pillow/java_tests/Main.java +21 -0
  50. pass_the_pillow/meta.json +97 -0
.gitattributes CHANGED
@@ -258,3 +258,7 @@ number_of_increasing_paths_in_a_grid/haskell_tests/Main.hs filter=lfs diff=lfs m
258
  number_of_increasing_paths_in_a_grid/meta.json filter=lfs diff=lfs merge=lfs -text
259
  number_of_pairs_satisfying_inequality/meta.json filter=lfs diff=lfs merge=lfs -text
260
  number_of_zero_filled_subarrays/meta.json filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
258
  number_of_increasing_paths_in_a_grid/meta.json filter=lfs diff=lfs merge=lfs -text
259
  number_of_pairs_satisfying_inequality/meta.json filter=lfs diff=lfs merge=lfs -text
260
  number_of_zero_filled_subarrays/meta.json filter=lfs diff=lfs merge=lfs -text
261
+ paint_house_iv/haskell_tests/Main.hs filter=lfs diff=lfs merge=lfs -text
262
+ paint_house_iv/meta.json filter=lfs diff=lfs merge=lfs -text
263
+ partition_array_according_to_given_pivot/meta.json filter=lfs diff=lfs merge=lfs -text
264
+ partition_array_such_that_maximum_difference_is_k/meta.json filter=lfs diff=lfs merge=lfs -text
odd_string_difference/.DS_Store ADDED
Binary file (6.15 kB). View file
 
odd_string_difference/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 (oddString [ \"adc \", \"wzy \", \"abc \"])," "abc" (oddString ["adc","wzy","abc"]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (oddString [ \"aaa \", \"bob \", \"ccc \", \"ddd \"])," "bob" (oddString ["aaa","bob","ccc","ddd"]))
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
odd_string_difference/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals("new ArrayList<>(Arrays.asList(adc,wzy,abc))", oddString(new ArrayList<>(Arrays.asList("adc","wzy","abc"))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("new ArrayList<>(Arrays.asList(aaa,bob,ccc,ddd))", oddString(new ArrayList<>(Arrays.asList("aaa","bob","ccc","ddd"))));
19
+ }
20
+
21
+ }
odd_string_difference/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2547,
3
+ "name": "odd_string_difference",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/odd-string-difference/",
6
+ "date": "1665792000000",
7
+ "task_description": "You are given an array of equal-length strings `words`. Assume that the length of each string is `n`. Each string `words[i]` can be converted into a **difference integer array** `difference[i]` of length `n - 1` where `difference[i][j] = words[i][j+1] - words[i][j]` where `0 <= j <= n - 2`. Note that the difference between two letters is the difference between their **positions** in the alphabet i.e. the position of `'a'` is `0`, `'b'` is `1`, and `'z'` is `25`. For example, for the string `\"acb\"`, the difference integer array is `[2 - 0, 1 - 2] = [2, -1]`. All the strings in words have the same difference integer array, **except one**. You should find that string. Return_ the string in _`words`_ that has different **difference integer array**._ **Example 1:** ``` **Input:** words = [\"adc\",\"wzy\",\"abc\"] **Output:** \"abc\" **Explanation:** - The difference integer array of \"adc\" is [3 - 0, 2 - 3] = [3, -1]. - The difference integer array of \"wzy\" is [25 - 22, 24 - 25]= [3, -1]. - The difference integer array of \"abc\" is [1 - 0, 2 - 1] = [1, 1]. The odd array out is [1, 1], so we return the corresponding string, \"abc\". ``` **Example 2:** ``` **Input:** words = [\"aaa\",\"bob\",\"ccc\",\"ddd\"] **Output:** \"bob\" **Explanation:** All the integer arrays are [0, 0] except for \"bob\", which corresponds to [13, -13]. ``` **Constraints:** `3 <= words.length <= 100` `n == words[i].length` `2 <= n <= 20` `words[i]` consists of lowercase English letters.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "words = [\"adc\",\"wzy\",\"abc\"]",
12
+ "output": "\"abc\" "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "words = [\"aaa\",\"bob\",\"ccc\",\"ddd\"]",
17
+ "output": "\"bob\" "
18
+ }
19
+ ],
20
+ "private_test_cases": [],
21
+ "haskell_template": "oddString :: [String] -> String\noddString words ",
22
+ "ocaml_template": "let oddString (words: string list) : string = ",
23
+ "scala_template": "def oddString(words: List[String]): String = { \n \n}",
24
+ "java_template": "public static String oddString(List<String> words) {\n\n}",
25
+ "python_template": "class Solution(object):\n def oddString(self, words):\n \"\"\"\n :type words: List[str]\n :rtype: str\n \"\"\"\n "
26
+ }
odd_string_difference/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 "abc" (oddString ["adc";"wzy";"abc"])
12
+
13
+ let test2 _ = assert_equal "bob" (oddString ["aaa";"bob";"ccc";"ddd"])
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for oddString" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
odd_string_difference/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.oddString(List("adc","wzy","abc")), "abc")
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.oddString(List("aaa","bob","ccc","ddd")), "bob")
10
+ }
11
+
12
+ }
optimal_partition_of_string/.DS_Store ADDED
Binary file (6.15 kB). View file
 
optimal_partition_of_string/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 (partitionString \"abacaba \")," 4 (partitionString "abacaba"))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (partitionString \"ssssss \")," 6 (partitionString "ssssss"))
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
optimal_partition_of_string/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, partitionString("abacaba"));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(6, partitionString("ssssss"));
19
+ }
20
+
21
+ }
optimal_partition_of_string/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
optimal_partition_of_string/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 4 (partitionString "abacaba")
12
+
13
+ let test2 _ = assert_equal 6 (partitionString "ssssss")
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for partitionString" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
optimal_partition_of_string/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.partitionString("abacaba"), 4)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.partitionString("ssssss"), 6)
10
+ }
11
+
12
+ }
paint_house_iv/haskell_tests/Main.hs ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ec51963f9301384a9bec6d7743ae135623acebae9f8e46ee164072a27fd2b10
3
+ size 12692339
paint_house_iv/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(9, minCost(4, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(3,5,7)),new ArrayList<>(Arrays.asList(6,2,9)),new ArrayList<>(Arrays.asList(4,8,1)),new ArrayList<>(Arrays.asList(7,3,5))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(18, minCost(6, new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(2,4,6)),new ArrayList<>(Arrays.asList(5,3,8)),new ArrayList<>(Arrays.asList(7,1,9)),new ArrayList<>(Arrays.asList(4,6,2)),new ArrayList<>(Arrays.asList(3,5,7)),new ArrayList<>(Arrays.asList(8,2,4))))));
19
+ }
20
+
21
+ }
paint_house_iv/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9765cf7a8edb079ace737f699e5ec8739893a85381ce884015659f7cc0b89a0
3
+ size 55002820
paint_house_iv/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
paint_house_iv/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
painting_the_walls/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 (paintWalls [1,2,3,2] [1,2,3,2])," 3 (paintWalls [1,2,3,2] [1,2,3,2]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (paintWalls [2,3,4,2] [1,1,1,1])," 4 (paintWalls [2,3,4,2] [1,1,1,1]))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (paintWalls [268643, 752013, 318161, 524677, 374576, 71970, 869505, 753435, 713518, 555757, 432948, 39983, 919949, 998079, 743129, 632026, 954321, 86066, 487112, 219176, 526603, 707334, 847105, 844438, 662067, 134805, 97818, 579412, 839247, 646698, 219873, 591959, 963949, 368585, 860097, 995546, 607846, 794911, 341445, 566022, 226895, 724644, 214879, 1224, 125133, 631015, 349852, 947247, 165023, 580195, 7821, 731000, 524780, 71120, 233463, 840417, 756273, 504263, 376014, 536514, 257219, 590802, 615186, 318017, 721816, 75727, 259781, 834518, 446513, 650293, 51585, 287106, 148135, 643831, 336710, 472402, 525148, 736766, 654887, 702024, 977224, 534789, 524642, 387706, 692517, 571525, 939096, 164256, 63828, 703658, 806005, 452115, 10093, 161712, 269827, 395792, 6388, 340843, 903234, 21804, 655074, 968151, 713861, 764184, 753589, 131157, 706735, 186618, 253999, 375799, 274504, 58355, 853990, 788371, 87125, 37646, 535702, 399072, 954288, 571946, 908174, 47192, 167639, 930987, 567730, 769180, 952783, 5104, 37700, 749527, 329309, 636215, 645541, 868987, 214681, 69876, 153598, 546001, 910316, 232998, 429262, 833199, 215902, 692400, 37338, 210426, 429757, 188895, 71745, 491429, 985882, 407873, 705374, 696411, 94483, 983842, 299451, 114047, 957948, 220421, 536487, 657446, 299160, 237534, 413175, 831359, 534403, 503757, 428862, 491142, 933802, 45408, 495984, 216287, 22281, 312069, 297321, 998372, 801067, 453947, 254632, 227422, 78780, 217526, 599246, 116704, 748265, 922753, 978512, 474290, 384912, 841481, 780530, 840285, 549211, 226337, 489835, 803716, 498851, 991346, 268561, 797339, 110448, 929171, 865408, 225606, 972804, 430652, 436186, 862140, 372258, 933431, 720598, 901910, 674953, 249997, 271784, 733756, 211323, 274067, 705862, 676353, 686812, 709634, 55379, 517632, 328622, 679798, 826822, 596440, 188536, 997377, 598642, 652474, 682295, 7392, 456962, 27696, 969305, 724757, 288412, 348399, 670232, 121396, 675422, 664409, 469005, 206405, 945464, 66504, 643527, 745406, 790754, 811590, 511994, 487778, 359376, 944804, 709979, 93876, 784462, 54152, 968032, 278407, 293901, 373199, 833798, 59173, 15748, 731829, 559825, 985302, 639013, 106196, 730480, 584668, 135533, 80031, 551554, 637390, 995410, 261960, 496932, 410176, 361604, 963798, 806467, 543085, 229218, 547445, 252242, 619774, 749657, 63719, 891703, 485297, 832433, 132769, 627085, 938083, 453512, 570305, 341200, 575882, 154468, 190979, 350680, 284335, 177392, 901085] [131, 44, 371, 455, 257, 472, 218, 173, 191, 229, 58, 370, 404, 258, 99, 4, 342, 25, 239, 284, 93, 446, 299, 109, 286, 434, 472, 55, 99, 346, 356, 279, 240, 352, 284, 49, 427, 120, 484, 319, 20, 182, 25, 49, 227, 439, 451, 187, 228, 499, 470, 240, 87, 116, 155, 462, 407, 354, 106, 219, 386, 421, 14, 109, 315, 17, 335, 499, 318, 178, 500, 78, 309, 25, 403, 104, 84, 328, 244, 368, 410, 28, 204, 15, 497, 238, 82, 166, 114, 323, 55, 419, 40, 14, 160, 162, 48, 374, 79, 479, 125, 277, 139, 190, 362, 365, 5, 319, 17, 101, 49, 374, 426, 267, 303, 25, 257, 139, 48, 17, 351, 150, 314, 224, 439, 278, 140, 350, 295, 460, 133, 329, 56, 21, 13, 258, 395, 234, 65, 234, 258, 219, 500, 310, 51, 332, 13, 400, 263, 129, 375, 168, 88, 450, 376, 95, 394, 209, 120, 214, 404, 437, 395, 19, 301, 476, 500, 422, 234, 454, 235, 156, 376, 93, 39, 323, 126, 495, 214, 477, 498, 184, 265, 69, 302, 10, 279, 121, 400, 387, 212, 475, 143, 367, 215, 341, 155, 270, 177, 244, 43, 129, 405, 339, 464, 253, 66, 392, 139, 130, 492, 465, 110, 313, 90, 480, 141, 453, 295, 83, 218, 261, 372, 203, 211, 497, 68, 309, 407, 292, 76, 280, 432, 53, 448, 380, 26, 183, 88, 298, 15, 296, 119, 193, 324, 241, 102, 72, 16, 149, 251, 140, 45, 233, 430, 459, 77, 69, 101, 135, 234, 495, 342, 267, 158, 167, 312, 29, 124, 421, 483, 81, 487, 99, 349, 141, 298, 309, 252, 274, 5, 40, 41, 404, 458, 221, 249, 204, 413, 131, 328, 114, 127, 414, 487, 381, 49, 258, 166, 383, 330, 224, 147, 80, 480, 300, 199, 436, 69, 349])," 5104 (paintWalls [268643, 752013, 318161, 524677, 374576, 71970, 869505, 753435, 713518, 555757, 432948, 39983, 919949, 998079, 743129, 632026, 954321, 86066, 487112, 219176, 526603, 707334, 847105, 844438, 662067, 134805, 97818, 579412, 839247, 646698, 219873, 591959, 963949, 368585, 860097, 995546, 607846, 794911, 341445, 566022, 226895, 724644, 214879, 1224, 125133, 631015, 349852, 947247, 165023, 580195, 7821, 731000, 524780, 71120, 233463, 840417, 756273, 504263, 376014, 536514, 257219, 590802, 615186, 318017, 721816, 75727, 259781, 834518, 446513, 650293, 51585, 287106, 148135, 643831, 336710, 472402, 525148, 736766, 654887, 702024, 977224, 534789, 524642, 387706, 692517, 571525, 939096, 164256, 63828, 703658, 806005, 452115, 10093, 161712, 269827, 395792, 6388, 340843, 903234, 21804, 655074, 968151, 713861, 764184, 753589, 131157, 706735, 186618, 253999, 375799, 274504, 58355, 853990, 788371, 87125, 37646, 535702, 399072, 954288, 571946, 908174, 47192, 167639, 930987, 567730, 769180, 952783, 5104, 37700, 749527, 329309, 636215, 645541, 868987, 214681, 69876, 153598, 546001, 910316, 232998, 429262, 833199, 215902, 692400, 37338, 210426, 429757, 188895, 71745, 491429, 985882, 407873, 705374, 696411, 94483, 983842, 299451, 114047, 957948, 220421, 536487, 657446, 299160, 237534, 413175, 831359, 534403, 503757, 428862, 491142, 933802, 45408, 495984, 216287, 22281, 312069, 297321, 998372, 801067, 453947, 254632, 227422, 78780, 217526, 599246, 116704, 748265, 922753, 978512, 474290, 384912, 841481, 780530, 840285, 549211, 226337, 489835, 803716, 498851, 991346, 268561, 797339, 110448, 929171, 865408, 225606, 972804, 430652, 436186, 862140, 372258, 933431, 720598, 901910, 674953, 249997, 271784, 733756, 211323, 274067, 705862, 676353, 686812, 709634, 55379, 517632, 328622, 679798, 826822, 596440, 188536, 997377, 598642, 652474, 682295, 7392, 456962, 27696, 969305, 724757, 288412, 348399, 670232, 121396, 675422, 664409, 469005, 206405, 945464, 66504, 643527, 745406, 790754, 811590, 511994, 487778, 359376, 944804, 709979, 93876, 784462, 54152, 968032, 278407, 293901, 373199, 833798, 59173, 15748, 731829, 559825, 985302, 639013, 106196, 730480, 584668, 135533, 80031, 551554, 637390, 995410, 261960, 496932, 410176, 361604, 963798, 806467, 543085, 229218, 547445, 252242, 619774, 749657, 63719, 891703, 485297, 832433, 132769, 627085, 938083, 453512, 570305, 341200, 575882, 154468, 190979, 350680, 284335, 177392, 901085] [131, 44, 371, 455, 257, 472, 218, 173, 191, 229, 58, 370, 404, 258, 99, 4, 342, 25, 239, 284, 93, 446, 299, 109, 286, 434, 472, 55, 99, 346, 356, 279, 240, 352, 284, 49, 427, 120, 484, 319, 20, 182, 25, 49, 227, 439, 451, 187, 228, 499, 470, 240, 87, 116, 155, 462, 407, 354, 106, 219, 386, 421, 14, 109, 315, 17, 335, 499, 318, 178, 500, 78, 309, 25, 403, 104, 84, 328, 244, 368, 410, 28, 204, 15, 497, 238, 82, 166, 114, 323, 55, 419, 40, 14, 160, 162, 48, 374, 79, 479, 125, 277, 139, 190, 362, 365, 5, 319, 17, 101, 49, 374, 426, 267, 303, 25, 257, 139, 48, 17, 351, 150, 314, 224, 439, 278, 140, 350, 295, 460, 133, 329, 56, 21, 13, 258, 395, 234, 65, 234, 258, 219, 500, 310, 51, 332, 13, 400, 263, 129, 375, 168, 88, 450, 376, 95, 394, 209, 120, 214, 404, 437, 395, 19, 301, 476, 500, 422, 234, 454, 235, 156, 376, 93, 39, 323, 126, 495, 214, 477, 498, 184, 265, 69, 302, 10, 279, 121, 400, 387, 212, 475, 143, 367, 215, 341, 155, 270, 177, 244, 43, 129, 405, 339, 464, 253, 66, 392, 139, 130, 492, 465, 110, 313, 90, 480, 141, 453, 295, 83, 218, 261, 372, 203, 211, 497, 68, 309, 407, 292, 76, 280, 432, 53, 448, 380, 26, 183, 88, 298, 15, 296, 119, 193, 324, 241, 102, 72, 16, 149, 251, 140, 45, 233, 430, 459, 77, 69, 101, 135, 234, 495, 342, 267, 158, 167, 312, 29, 124, 421, 483, 81, 487, 99, 349, 141, 298, 309, 252, 274, 5, 40, 41, 404, 458, 221, 249, 204, 413, 131, 328, 114, 127, 414, 487, 381, 49, 258, 166, 383, 330, 224, 147, 80, 480, 300, 199, 436, 69, 349]))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (paintWalls [631329, 506660, 874006, 401735, 430561, 164160, 733867, 138222, 156550, 808780, 985691, 657587, 454859, 26589, 286211, 316886, 690358, 852726, 534985, 74133, 739358, 244539, 482883, 933540, 548468, 762765, 649239, 322588, 941345, 333442, 827161, 902433, 361815, 664147, 464517, 684981, 793801, 451318, 649211, 86156, 662848, 862040, 960861, 59335, 893175, 317614, 536319, 377137, 16431, 124016, 11964, 303335, 940093, 515074, 403052, 32856, 14421, 681882, 637736, 42382, 857659, 829788, 207282, 512718, 153297, 899340, 657254, 379387, 581472, 825855, 945933, 977553, 86675] [335, 9, 355, 469, 231, 55, 197, 474, 369, 174, 46, 420, 228, 432, 301, 311, 410, 346, 420, 70, 485, 436, 66, 424, 300, 12, 350, 294, 484, 191, 334, 137, 179, 343, 192, 471, 366, 389, 466, 80, 280, 8, 380, 387, 477, 290, 235, 215, 458, 206, 167, 202, 353, 143, 190, 383, 179, 290, 416, 499, 275, 482, 418, 445, 23, 432, 364, 174, 328, 67, 396, 78, 490])," 11964 (paintWalls [631329, 506660, 874006, 401735, 430561, 164160, 733867, 138222, 156550, 808780, 985691, 657587, 454859, 26589, 286211, 316886, 690358, 852726, 534985, 74133, 739358, 244539, 482883, 933540, 548468, 762765, 649239, 322588, 941345, 333442, 827161, 902433, 361815, 664147, 464517, 684981, 793801, 451318, 649211, 86156, 662848, 862040, 960861, 59335, 893175, 317614, 536319, 377137, 16431, 124016, 11964, 303335, 940093, 515074, 403052, 32856, 14421, 681882, 637736, 42382, 857659, 829788, 207282, 512718, 153297, 899340, 657254, 379387, 581472, 825855, 945933, 977553, 86675] [335, 9, 355, 469, 231, 55, 197, 474, 369, 174, 46, 420, 228, 432, 301, 311, 410, 346, 420, 70, 485, 436, 66, 424, 300, 12, 350, 294, 484, 191, 334, 137, 179, 343, 192, 471, 366, 389, 466, 80, 280, 8, 380, 387, 477, 290, 235, 215, 458, 206, 167, 202, 353, 143, 190, 383, 179, 290, 416, 499, 275, 482, 418, 445, 23, 432, 364, 174, 328, 67, 396, 78, 490]))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (paintWalls [383062, 295970, 824925, 593850, 70562, 86341, 730776, 323615, 206218, 841019, 172809, 256030, 645635, 561442, 832083, 381521, 521692, 322999, 55224, 56026, 412442, 128659, 734069, 534423, 709414, 466526, 452666, 494189, 351898, 498833, 991296, 735113, 145223, 319188, 474687, 23058, 794685, 953924, 96220, 457219, 342148, 260003, 978641, 76385, 411956, 76487, 714636, 408791, 43997, 41801, 322982, 313679, 300810, 262792, 509510, 853117, 579646, 181960, 929370, 884642, 188650, 452775, 227232, 911617, 711394, 938681, 389824, 172997, 34325, 263032, 455947, 422537, 873813, 183891] [405, 407, 156, 137, 320, 474, 421, 149, 379, 420, 191, 117, 401, 60, 148, 442, 319, 71, 342, 321, 404, 88, 379, 129, 446, 143, 467, 137, 439, 143, 11, 411, 307, 125, 146, 253, 311, 265, 485, 233, 299, 194, 257, 397, 31, 478, 111, 115, 195, 465, 48, 9, 342, 261, 344, 38, 286, 492, 351, 195, 259, 309, 2, 120, 475, 353, 412, 370, 373, 401, 263, 205, 339, 23])," 23058 (paintWalls [383062, 295970, 824925, 593850, 70562, 86341, 730776, 323615, 206218, 841019, 172809, 256030, 645635, 561442, 832083, 381521, 521692, 322999, 55224, 56026, 412442, 128659, 734069, 534423, 709414, 466526, 452666, 494189, 351898, 498833, 991296, 735113, 145223, 319188, 474687, 23058, 794685, 953924, 96220, 457219, 342148, 260003, 978641, 76385, 411956, 76487, 714636, 408791, 43997, 41801, 322982, 313679, 300810, 262792, 509510, 853117, 579646, 181960, 929370, 884642, 188650, 452775, 227232, 911617, 711394, 938681, 389824, 172997, 34325, 263032, 455947, 422537, 873813, 183891] [405, 407, 156, 137, 320, 474, 421, 149, 379, 420, 191, 117, 401, 60, 148, 442, 319, 71, 342, 321, 404, 88, 379, 129, 446, 143, 467, 137, 439, 143, 11, 411, 307, 125, 146, 253, 311, 265, 485, 233, 299, 194, 257, 397, 31, 478, 111, 115, 195, 465, 48, 9, 342, 261, 344, 38, 286, 492, 351, 195, 259, 309, 2, 120, 475, 353, 412, 370, 373, 401, 263, 205, 339, 23]))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (paintWalls [703636, 708634, 94980, 40938, 577470, 696595, 333731, 191081, 130543, 280587, 743484, 350460, 177591, 119594, 899495, 91410, 520442, 19573, 56790, 289610, 957950, 681849, 178275, 549135, 855718, 162166, 480042, 914072, 786134, 317091, 414645, 440592, 474075, 187627, 474718, 941088, 753537, 842721, 72238, 462069, 523685, 682520, 649446, 828422, 746014, 712180, 592078, 207488, 957481, 310062, 311152, 393331, 780577, 814475, 967048, 185844, 542782, 92429, 317513, 460350, 469782, 273335, 190099, 963286, 868173, 535911, 135438, 811289, 691443, 436123, 799031, 225912, 856, 972731, 615004, 635663, 479735, 423684, 899147, 622261, 446432, 391433, 428920, 105526, 997659, 313946, 454822, 834248, 65923, 650857, 134599, 930902, 767630, 143051, 669083, 861559, 12442, 854383, 979161, 989971, 144166, 750275, 280174, 349808, 29171, 534216, 682826, 154459, 626607, 2915, 470449, 496691, 7149, 514111, 746199, 782023, 378189, 742696, 961321, 441206, 879003, 125149, 403849, 654448, 677184, 312963, 907463, 730371, 504032, 60724, 871098, 959021, 906540, 706134, 257493, 935158, 109960, 518053, 796164, 869334, 303056, 531442, 747726, 159305, 826973, 956003, 11162, 65194, 96674, 696589, 132105, 995657, 28654, 470485, 643755, 492043, 176175, 131153, 609855, 3143, 593633, 589661, 414208, 704162, 878078, 487526, 891675, 91392, 666687, 340781, 694941, 461988, 556951, 449758, 851100, 402512, 145446, 640228, 929739, 252262, 529654, 554985, 240895, 444965, 837768, 277757, 765348, 961463, 315516, 909247, 576292, 592910, 213030, 513372, 933734, 605587, 815508, 485787, 60036, 612464, 980139, 297509, 910462, 647252, 351849, 95741, 259906, 629712, 618124, 995448, 599321, 163048, 945205, 339538, 426754, 242137, 900491, 233626, 641026, 342219, 747182, 237345, 308701, 533601, 16381, 470248, 969107, 235522, 56202, 78555, 251863, 927067, 918320, 297920, 505067, 949842, 157647, 877581, 875557, 384513, 601165, 840913, 79459, 758914, 511220, 536350, 185485, 105499, 852067, 855141, 584368, 134164, 17540, 467504, 188353, 715011, 661262, 105074, 935596, 965107, 285662, 927299, 558537, 31161, 307713] [5, 342, 334, 292, 207, 165, 484, 88, 344, 227, 209, 371, 365, 445, 231, 41, 250, 249, 30, 154, 389, 481, 380, 23, 135, 35, 203, 340, 413, 223, 348, 185, 248, 183, 337, 113, 438, 76, 154, 36, 241, 483, 471, 229, 319, 288, 86, 23, 274, 262, 336, 416, 4, 245, 355, 379, 51, 76, 115, 234, 94, 421, 133, 74, 66, 348, 58, 314, 317, 6, 463, 473, 475, 105, 212, 470, 35, 285, 448, 468, 101, 114, 128, 413, 118, 268, 421, 257, 377, 47, 391, 227, 320, 430, 311, 254, 193, 76, 115, 325, 183, 417, 200, 285, 408, 212, 358, 187, 491, 370, 179, 493, 284, 137, 325, 364, 213, 164, 370, 52, 58, 500, 151, 78, 262, 467, 277, 15, 366, 309, 418, 375, 482, 146, 274, 236, 13, 197, 459, 53, 238, 399, 181, 421, 125, 289, 186, 222, 410, 107, 400, 214, 66, 286, 278, 206, 6, 166, 208, 288, 337, 140, 487, 5, 331, 258, 64, 138, 218, 481, 92, 312, 249, 94, 284, 3, 360, 298, 84, 298, 48, 383, 346, 73, 304, 341, 454, 384, 169, 28, 184, 471, 86, 228, 31, 364, 18, 241, 300, 149, 201, 327, 500, 405, 402, 256, 143, 13, 9, 231, 308, 23, 198, 158, 196, 357, 286, 466, 33, 128, 283, 47, 235, 339, 19, 293, 102, 331, 286, 323, 301, 378, 478, 489, 145, 289, 348, 395, 29, 428, 34, 72, 80, 287, 373, 72, 491, 271, 71, 426, 139, 215, 240, 276, 374, 465, 46, 150, 54, 141, 34, 462, 390, 263, 140])," 856 (paintWalls [703636, 708634, 94980, 40938, 577470, 696595, 333731, 191081, 130543, 280587, 743484, 350460, 177591, 119594, 899495, 91410, 520442, 19573, 56790, 289610, 957950, 681849, 178275, 549135, 855718, 162166, 480042, 914072, 786134, 317091, 414645, 440592, 474075, 187627, 474718, 941088, 753537, 842721, 72238, 462069, 523685, 682520, 649446, 828422, 746014, 712180, 592078, 207488, 957481, 310062, 311152, 393331, 780577, 814475, 967048, 185844, 542782, 92429, 317513, 460350, 469782, 273335, 190099, 963286, 868173, 535911, 135438, 811289, 691443, 436123, 799031, 225912, 856, 972731, 615004, 635663, 479735, 423684, 899147, 622261, 446432, 391433, 428920, 105526, 997659, 313946, 454822, 834248, 65923, 650857, 134599, 930902, 767630, 143051, 669083, 861559, 12442, 854383, 979161, 989971, 144166, 750275, 280174, 349808, 29171, 534216, 682826, 154459, 626607, 2915, 470449, 496691, 7149, 514111, 746199, 782023, 378189, 742696, 961321, 441206, 879003, 125149, 403849, 654448, 677184, 312963, 907463, 730371, 504032, 60724, 871098, 959021, 906540, 706134, 257493, 935158, 109960, 518053, 796164, 869334, 303056, 531442, 747726, 159305, 826973, 956003, 11162, 65194, 96674, 696589, 132105, 995657, 28654, 470485, 643755, 492043, 176175, 131153, 609855, 3143, 593633, 589661, 414208, 704162, 878078, 487526, 891675, 91392, 666687, 340781, 694941, 461988, 556951, 449758, 851100, 402512, 145446, 640228, 929739, 252262, 529654, 554985, 240895, 444965, 837768, 277757, 765348, 961463, 315516, 909247, 576292, 592910, 213030, 513372, 933734, 605587, 815508, 485787, 60036, 612464, 980139, 297509, 910462, 647252, 351849, 95741, 259906, 629712, 618124, 995448, 599321, 163048, 945205, 339538, 426754, 242137, 900491, 233626, 641026, 342219, 747182, 237345, 308701, 533601, 16381, 470248, 969107, 235522, 56202, 78555, 251863, 927067, 918320, 297920, 505067, 949842, 157647, 877581, 875557, 384513, 601165, 840913, 79459, 758914, 511220, 536350, 185485, 105499, 852067, 855141, 584368, 134164, 17540, 467504, 188353, 715011, 661262, 105074, 935596, 965107, 285662, 927299, 558537, 31161, 307713] [5, 342, 334, 292, 207, 165, 484, 88, 344, 227, 209, 371, 365, 445, 231, 41, 250, 249, 30, 154, 389, 481, 380, 23, 135, 35, 203, 340, 413, 223, 348, 185, 248, 183, 337, 113, 438, 76, 154, 36, 241, 483, 471, 229, 319, 288, 86, 23, 274, 262, 336, 416, 4, 245, 355, 379, 51, 76, 115, 234, 94, 421, 133, 74, 66, 348, 58, 314, 317, 6, 463, 473, 475, 105, 212, 470, 35, 285, 448, 468, 101, 114, 128, 413, 118, 268, 421, 257, 377, 47, 391, 227, 320, 430, 311, 254, 193, 76, 115, 325, 183, 417, 200, 285, 408, 212, 358, 187, 491, 370, 179, 493, 284, 137, 325, 364, 213, 164, 370, 52, 58, 500, 151, 78, 262, 467, 277, 15, 366, 309, 418, 375, 482, 146, 274, 236, 13, 197, 459, 53, 238, 399, 181, 421, 125, 289, 186, 222, 410, 107, 400, 214, 66, 286, 278, 206, 6, 166, 208, 288, 337, 140, 487, 5, 331, 258, 64, 138, 218, 481, 92, 312, 249, 94, 284, 3, 360, 298, 84, 298, 48, 383, 346, 73, 304, 341, 454, 384, 169, 28, 184, 471, 86, 228, 31, 364, 18, 241, 300, 149, 201, 327, 500, 405, 402, 256, 143, 13, 9, 231, 308, 23, 198, 158, 196, 357, 286, 466, 33, 128, 283, 47, 235, 339, 19, 293, 102, 331, 286, 323, 301, 378, 478, 489, 145, 289, 348, 395, 29, 428, 34, 72, 80, 287, 373, 72, 491, 271, 71, 426, 139, 215, 240, 276, 374, 465, 46, 150, 54, 141, 34, 462, 390, 263, 140]))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (paintWalls [196386, 515278, 487523, 572433, 823844, 868848, 210915, 984051, 20744, 143583, 711988, 111364, 891432, 87302, 638169, 518912, 230503, 421630, 493829, 215949, 588405, 500819, 368210, 493304, 504549, 447332, 620438, 113584, 939469, 459996, 258059, 125145, 11230, 841719, 548600, 683642, 40062, 753346, 123307, 423429, 707124, 811387, 167263, 16219, 318283, 50396, 955842, 463103, 209153, 390201, 818263, 539815, 874791, 414568, 415482, 162566, 523543, 751162, 55546, 416736, 328224, 296521, 20819, 230588, 832248, 941589, 41728, 19856, 574428, 824532, 148708, 565872, 935863, 933044, 304521, 731639, 96667, 998617, 456973, 55607, 434306, 927311, 114018, 265751, 120417, 531679, 758998, 575631, 880764, 287305, 772931, 667170, 668484, 602548, 967150, 966595, 236038, 874434, 90356, 441488, 872239, 427715, 427814, 975891, 316107, 706206, 864261, 617549, 918129, 467314, 569743, 613661, 961359, 414982, 757567, 524437, 538579, 191132, 836552, 988856, 735461, 928256, 541449, 111647, 763615, 95629, 959484, 180078, 657378, 401607, 482430, 712398, 37890, 140115, 946153, 55111, 382299, 428515, 275117, 475686, 992883, 487829, 105799, 515137, 923658, 242664, 31463, 419336, 915770, 901223, 763301, 936899, 493776, 441390, 867949, 165577, 349149, 123750, 90392, 569723, 516379, 243677, 541086, 290840, 387176, 654384, 798559, 134312, 846097, 159971, 274779, 486304, 674969, 492387, 6655, 12796, 680802, 918899, 286355, 731544, 304365, 228883, 214665, 468434, 56100, 226998, 48068, 135624, 490077, 166702, 264919, 690315, 454653, 626249, 316911, 403409, 676425, 726402, 693462, 948476, 3458, 620880, 270213, 314996, 649593, 166258, 408021, 611914, 249070, 849760, 366452, 471193, 228365, 834070, 770049, 974222, 835291, 230008, 183141, 304003, 891071, 433346, 747621, 567098, 426127, 990315, 691608, 894598, 803772, 412710, 717223, 350610, 492018, 776090, 427154, 792988, 274518, 782535, 928893, 305552, 408379, 755700, 808297, 536286, 253443, 307235, 511986, 152741, 882930, 766079, 962725, 720283, 694200, 552526, 114318, 711552, 962232, 955828, 44259, 35623, 980636, 361234, 487118, 719585, 901046, 889323, 49772, 844541, 56201, 990335, 999145, 637794, 105791, 32872, 667802, 51469, 206472, 443272, 45738, 634654, 303810, 910244, 894205, 921083, 10955, 737568, 540681, 882298, 127727, 126297, 23469, 6102, 695396, 70223, 711714, 904931, 606455, 91878, 191869, 7411, 752051, 844182, 323449, 483215, 238406, 520834, 853454, 781399, 96077, 476266, 522534, 863813, 743010, 732344, 350589, 269207, 439151, 287897, 935619, 571399, 832074, 170220, 206113, 243127, 418201, 761054, 63681, 109316, 171172, 960285, 668508, 32749, 441014, 828373, 243092, 88390, 472126, 994820, 230849, 54855, 770656, 163530, 246048, 128335] [492, 35, 154, 466, 211, 428, 209, 39, 143, 255, 345, 404, 145, 232, 107, 162, 255, 311, 68, 283, 286, 394, 185, 484, 178, 456, 157, 95, 263, 234, 432, 471, 362, 98, 422, 456, 444, 339, 29, 354, 444, 31, 217, 173, 258, 3, 157, 114, 372, 31, 245, 349, 109, 217, 131, 229, 35, 231, 356, 3, 495, 310, 257, 316, 288, 354, 66, 307, 282, 50, 419, 89, 102, 343, 73, 423, 277, 326, 167, 48, 419, 164, 103, 393, 316, 226, 221, 110, 199, 272, 135, 82, 7, 339, 387, 189, 240, 216, 323, 403, 81, 252, 33, 426, 413, 364, 63, 468, 54, 245, 467, 372, 466, 451, 253, 246, 115, 316, 82, 64, 389, 351, 198, 484, 269, 48, 134, 185, 76, 34, 56, 421, 476, 368, 309, 241, 334, 180, 99, 241, 360, 493, 409, 399, 315, 354, 102, 217, 445, 136, 288, 498, 232, 111, 131, 140, 33, 57, 452, 27, 118, 32, 475, 339, 87, 464, 409, 314, 293, 283, 153, 332, 444, 485, 178, 151, 408, 317, 149, 367, 244, 103, 4, 278, 470, 62, 18, 374, 471, 323, 440, 309, 82, 362, 45, 226, 32, 403, 387, 9, 87, 38, 303, 123, 406, 205, 275, 438, 218, 416, 364, 484, 353, 79, 263, 418, 324, 126, 465, 321, 412, 375, 195, 353, 108, 474, 9, 465, 45, 109, 212, 200, 103, 161, 367, 25, 433, 487, 48, 32, 83, 464, 262, 241, 274, 261, 118, 212, 362, 422, 141, 5, 117, 202, 361, 273, 185, 160, 109, 348, 240, 270, 178, 390, 203, 267, 461, 476, 411, 433, 236, 407, 55, 84, 393, 447, 440, 31, 132, 479, 132, 85, 418, 100, 358, 477, 194, 452, 371, 215, 314, 440, 356, 404, 437, 497, 58, 207, 421, 90, 164, 145, 410, 350, 284, 280, 392, 322, 222, 467, 244, 84, 38, 219, 410, 94, 195, 268, 485, 498, 71, 226, 247, 195, 487, 411, 38, 324, 1, 120, 304, 181, 78, 472, 95, 256, 299, 206, 378, 291, 299, 499, 42, 271])," 6102 (paintWalls [196386, 515278, 487523, 572433, 823844, 868848, 210915, 984051, 20744, 143583, 711988, 111364, 891432, 87302, 638169, 518912, 230503, 421630, 493829, 215949, 588405, 500819, 368210, 493304, 504549, 447332, 620438, 113584, 939469, 459996, 258059, 125145, 11230, 841719, 548600, 683642, 40062, 753346, 123307, 423429, 707124, 811387, 167263, 16219, 318283, 50396, 955842, 463103, 209153, 390201, 818263, 539815, 874791, 414568, 415482, 162566, 523543, 751162, 55546, 416736, 328224, 296521, 20819, 230588, 832248, 941589, 41728, 19856, 574428, 824532, 148708, 565872, 935863, 933044, 304521, 731639, 96667, 998617, 456973, 55607, 434306, 927311, 114018, 265751, 120417, 531679, 758998, 575631, 880764, 287305, 772931, 667170, 668484, 602548, 967150, 966595, 236038, 874434, 90356, 441488, 872239, 427715, 427814, 975891, 316107, 706206, 864261, 617549, 918129, 467314, 569743, 613661, 961359, 414982, 757567, 524437, 538579, 191132, 836552, 988856, 735461, 928256, 541449, 111647, 763615, 95629, 959484, 180078, 657378, 401607, 482430, 712398, 37890, 140115, 946153, 55111, 382299, 428515, 275117, 475686, 992883, 487829, 105799, 515137, 923658, 242664, 31463, 419336, 915770, 901223, 763301, 936899, 493776, 441390, 867949, 165577, 349149, 123750, 90392, 569723, 516379, 243677, 541086, 290840, 387176, 654384, 798559, 134312, 846097, 159971, 274779, 486304, 674969, 492387, 6655, 12796, 680802, 918899, 286355, 731544, 304365, 228883, 214665, 468434, 56100, 226998, 48068, 135624, 490077, 166702, 264919, 690315, 454653, 626249, 316911, 403409, 676425, 726402, 693462, 948476, 3458, 620880, 270213, 314996, 649593, 166258, 408021, 611914, 249070, 849760, 366452, 471193, 228365, 834070, 770049, 974222, 835291, 230008, 183141, 304003, 891071, 433346, 747621, 567098, 426127, 990315, 691608, 894598, 803772, 412710, 717223, 350610, 492018, 776090, 427154, 792988, 274518, 782535, 928893, 305552, 408379, 755700, 808297, 536286, 253443, 307235, 511986, 152741, 882930, 766079, 962725, 720283, 694200, 552526, 114318, 711552, 962232, 955828, 44259, 35623, 980636, 361234, 487118, 719585, 901046, 889323, 49772, 844541, 56201, 990335, 999145, 637794, 105791, 32872, 667802, 51469, 206472, 443272, 45738, 634654, 303810, 910244, 894205, 921083, 10955, 737568, 540681, 882298, 127727, 126297, 23469, 6102, 695396, 70223, 711714, 904931, 606455, 91878, 191869, 7411, 752051, 844182, 323449, 483215, 238406, 520834, 853454, 781399, 96077, 476266, 522534, 863813, 743010, 732344, 350589, 269207, 439151, 287897, 935619, 571399, 832074, 170220, 206113, 243127, 418201, 761054, 63681, 109316, 171172, 960285, 668508, 32749, 441014, 828373, 243092, 88390, 472126, 994820, 230849, 54855, 770656, 163530, 246048, 128335] [492, 35, 154, 466, 211, 428, 209, 39, 143, 255, 345, 404, 145, 232, 107, 162, 255, 311, 68, 283, 286, 394, 185, 484, 178, 456, 157, 95, 263, 234, 432, 471, 362, 98, 422, 456, 444, 339, 29, 354, 444, 31, 217, 173, 258, 3, 157, 114, 372, 31, 245, 349, 109, 217, 131, 229, 35, 231, 356, 3, 495, 310, 257, 316, 288, 354, 66, 307, 282, 50, 419, 89, 102, 343, 73, 423, 277, 326, 167, 48, 419, 164, 103, 393, 316, 226, 221, 110, 199, 272, 135, 82, 7, 339, 387, 189, 240, 216, 323, 403, 81, 252, 33, 426, 413, 364, 63, 468, 54, 245, 467, 372, 466, 451, 253, 246, 115, 316, 82, 64, 389, 351, 198, 484, 269, 48, 134, 185, 76, 34, 56, 421, 476, 368, 309, 241, 334, 180, 99, 241, 360, 493, 409, 399, 315, 354, 102, 217, 445, 136, 288, 498, 232, 111, 131, 140, 33, 57, 452, 27, 118, 32, 475, 339, 87, 464, 409, 314, 293, 283, 153, 332, 444, 485, 178, 151, 408, 317, 149, 367, 244, 103, 4, 278, 470, 62, 18, 374, 471, 323, 440, 309, 82, 362, 45, 226, 32, 403, 387, 9, 87, 38, 303, 123, 406, 205, 275, 438, 218, 416, 364, 484, 353, 79, 263, 418, 324, 126, 465, 321, 412, 375, 195, 353, 108, 474, 9, 465, 45, 109, 212, 200, 103, 161, 367, 25, 433, 487, 48, 32, 83, 464, 262, 241, 274, 261, 118, 212, 362, 422, 141, 5, 117, 202, 361, 273, 185, 160, 109, 348, 240, 270, 178, 390, 203, 267, 461, 476, 411, 433, 236, 407, 55, 84, 393, 447, 440, 31, 132, 479, 132, 85, 418, 100, 358, 477, 194, 452, 371, 215, 314, 440, 356, 404, 437, 497, 58, 207, 421, 90, 164, 145, 410, 350, 284, 280, 392, 322, 222, 467, 244, 84, 38, 219, 410, 94, 195, 268, 485, 498, 71, 226, 247, 195, 487, 411, 38, 324, 1, 120, 304, 181, 78, 472, 95, 256, 299, 206, 378, 291, 299, 499, 42, 271]))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (paintWalls [542932, 176748, 528763, 723496, 205229, 569602, 855413, 252409, 451644, 752515, 391378, 552141, 918526, 608397, 790351, 547393, 36987, 399333, 693449, 507850, 257562, 957301, 80124, 46962, 617075, 738660, 739606, 208005, 245619, 999747, 926465, 857235, 32314, 151653, 403719, 129163, 111217, 247632, 989445, 70773, 798094, 119830, 857546, 768177, 469061, 593438, 192602, 793793, 983811, 527957, 471132, 332839, 578695, 625665, 539311, 709077, 508455, 898232, 497152, 557317, 304355, 491761, 149263, 291055, 543057, 909762, 286684, 209263, 809584, 643006, 248488, 480365, 481572, 665681, 602314, 779717, 297994, 790629, 133977, 91611, 26589, 363499, 489816, 867966, 322271, 142219, 663326, 952428, 509719, 435273, 623918, 44859, 550995, 408929, 837041, 287107, 814889, 170652, 21272, 911567, 180075, 706453, 469966, 515095, 93090, 972562, 162587, 382528, 135270, 137527, 65395, 773540, 916033, 432874, 75035, 993526, 439715, 606919, 947861, 795089, 683259, 698370, 991693, 440152, 492648, 762356, 901542, 314605, 437478, 544278, 708501, 742927, 826138, 53033, 405592, 308437, 832635, 154543, 577190, 802244, 550509, 371448, 406462, 219024, 416924, 289491, 886016, 961607, 173599, 617886, 43146, 870084, 156990, 586596, 656088, 131117, 916728, 659394, 318884, 597270, 75532, 435071, 757293, 588155, 2395, 621737, 72227, 10064, 164948, 759882, 233833, 613101, 360107, 753743, 760038, 510667, 401783, 90913, 854566, 488303, 407893, 940594, 103064, 341305, 320297, 737299, 984074, 341451, 602349, 816863, 703311, 853208, 245951, 13876, 110802, 83218, 273585, 400508, 650311, 675898, 103351, 47356, 795687, 371693, 65057, 957791, 559519, 290648, 118321, 645381, 198342, 691144, 392626, 651445, 732465, 88741, 100881, 324264, 20258, 54198, 683430, 663870, 789564, 424050, 445109, 544906, 669549, 910184, 971750, 346977, 373410, 287388, 58631, 964018, 345149, 369731, 750120, 409430, 78313, 831366, 203177, 43768, 822715, 638808, 84078, 716323, 709795, 329365, 373709, 294495, 644868, 249288, 773645, 863862, 368110, 829215, 790585, 878798, 858714, 618500, 707792, 584552, 417696, 923809, 462187, 351921, 604817, 213153, 125789, 987390, 905733, 955801, 2932, 124623, 207751, 597737, 40510, 50084, 388339, 456445, 980679, 156742, 976366, 691822, 599552, 294660, 904345, 982801, 380365, 505404, 964699, 924150, 619304, 505995, 235354, 946421, 607981, 496575, 460603, 734771, 428742, 483678, 398382, 231091, 906368, 207310, 508187, 161200, 49077, 632603, 962138, 617116, 935491, 58057, 190347, 686536, 47224, 709475, 278422, 246483, 67382, 20610, 699295, 106076, 102406, 37326, 672398, 905822, 489179, 377490, 111997, 114897, 705579, 568004, 867084, 966172, 340731, 176051, 813005, 87385, 882562, 530183, 13651, 107968, 299288, 833913, 969691, 619770, 453490, 272332, 812831, 462269, 129512, 264247, 857887, 387827, 218513, 183900, 829792, 478893, 400394, 17576, 445030, 185498, 443246, 382949, 948359, 392625, 72716, 197136, 246564, 398258, 392090, 199975, 644412, 251305, 580446, 640601, 102437, 723261, 835904, 201225, 858990, 510162, 234708, 790980, 81, 761931, 60344, 76146, 699144, 430382, 111149, 551102, 321450, 621163, 841651, 421390, 264206, 334624, 166053, 584921, 856878, 966169, 841387, 608564, 51917, 662103, 635977, 955092, 533106, 827588, 494139, 513866, 551425, 700047, 298784, 534969, 689767, 577466, 764215, 550677, 205660, 816815, 544069, 338126, 592241, 42069, 182915, 807399, 566417, 719342, 8133, 324389, 897757, 889058, 408495, 931815, 28019, 900376, 605755, 333986, 327537, 368020, 828969, 916177, 751890, 35729, 746341, 54714, 310790, 771489, 629188, 675562, 967251, 649251, 17915, 719903, 318917, 786760, 265454, 740017, 393589, 537164, 268192, 105167, 206809, 804738, 134815, 67957, 135015, 663517, 781332, 527906, 316245, 481291, 113187, 209096, 569345, 381543, 25082, 729111, 586903, 488866, 563639, 190577, 854791, 204704, 795645] [288, 457, 415, 33, 18, 397, 324, 193, 340, 109, 199, 291, 440, 160, 47, 140, 366, 106, 441, 25, 240, 402, 148, 245, 81, 342, 153, 174, 302, 198, 238, 208, 363, 108, 205, 66, 427, 312, 142, 8, 276, 159, 460, 248, 39, 231, 380, 300, 264, 460, 476, 107, 493, 34, 213, 46, 31, 110, 30, 49, 328, 10, 331, 355, 405, 452, 86, 362, 160, 191, 126, 452, 238, 200, 482, 472, 75, 385, 155, 99, 275, 115, 1, 120, 171, 363, 390, 333, 11, 485, 264, 449, 483, 37, 242, 377, 433, 74, 302, 263, 387, 381, 328, 56, 230, 309, 445, 52, 239, 107, 38, 449, 74, 186, 432, 352, 132, 416, 231, 69, 469, 85, 481, 393, 139, 118, 50, 124, 305, 366, 162, 295, 417, 458, 272, 472, 232, 466, 316, 359, 161, 342, 313, 87, 338, 446, 59, 247, 426, 131, 54, 312, 262, 98, 326, 284, 167, 20, 394, 23, 11, 176, 95, 390, 103, 195, 341, 470, 355, 333, 336, 68, 379, 57, 447, 127, 170, 240, 423, 346, 403, 375, 395, 74, 34, 64, 309, 48, 67, 62, 173, 369, 79, 312, 235, 270, 274, 20, 148, 282, 288, 347, 430, 180, 12, 33, 139, 450, 238, 410, 330, 481, 337, 310, 357, 439, 236, 395, 451, 313, 69, 384, 438, 126, 213, 68, 329, 349, 310, 223, 38, 146, 6, 188, 188, 100, 384, 248, 269, 481, 179, 401, 90, 433, 395, 233, 237, 481, 330, 171, 145, 338, 126, 119, 297, 14, 138, 381, 316, 38, 27, 63, 305, 203, 493, 430, 458, 39, 389, 355, 333, 316, 68, 254, 332, 76, 52, 19, 490, 378, 359, 289, 351, 199, 438, 241, 492, 244, 324, 62, 31, 486, 27, 226, 261, 377, 33, 475, 350, 238, 58, 407, 434, 174, 350, 86, 258, 371, 413, 49, 126, 307, 41, 136, 76, 257, 467, 189, 369, 459, 12, 45, 94, 29, 99, 443, 423, 87, 95, 280, 29, 398, 237, 449, 50, 37, 469, 285, 12, 160, 97, 65, 332, 14, 37, 283, 316, 75, 121, 366, 413, 274, 250, 483, 491, 461, 296, 331, 328, 239, 172, 217, 468, 395, 225, 254, 151, 48, 241, 335, 440, 255, 442, 2, 10, 370, 277, 296, 416, 226, 170, 287, 487, 417, 391, 100, 154, 250, 66, 320, 319, 308, 331, 409, 310, 432, 258, 356, 3, 98, 324, 428, 135, 460, 148, 222, 206, 296, 190, 319, 426, 70, 188, 34, 489, 61, 470, 315, 387, 26, 72, 116, 388, 274, 216, 123, 26, 18, 493, 380, 181, 137, 302, 36, 257, 12, 229, 475, 126, 112, 123, 417, 37, 375, 426, 395, 381, 248, 345, 22, 323, 50, 195, 429, 375, 320, 176, 136, 382, 26, 81, 25, 488, 140, 324, 477, 25, 473, 133, 202, 260, 432, 254, 241, 110, 425, 71, 77, 466, 121, 36, 136, 405, 477, 309, 421, 102, 212, 324])," 10145 (paintWalls [542932, 176748, 528763, 723496, 205229, 569602, 855413, 252409, 451644, 752515, 391378, 552141, 918526, 608397, 790351, 547393, 36987, 399333, 693449, 507850, 257562, 957301, 80124, 46962, 617075, 738660, 739606, 208005, 245619, 999747, 926465, 857235, 32314, 151653, 403719, 129163, 111217, 247632, 989445, 70773, 798094, 119830, 857546, 768177, 469061, 593438, 192602, 793793, 983811, 527957, 471132, 332839, 578695, 625665, 539311, 709077, 508455, 898232, 497152, 557317, 304355, 491761, 149263, 291055, 543057, 909762, 286684, 209263, 809584, 643006, 248488, 480365, 481572, 665681, 602314, 779717, 297994, 790629, 133977, 91611, 26589, 363499, 489816, 867966, 322271, 142219, 663326, 952428, 509719, 435273, 623918, 44859, 550995, 408929, 837041, 287107, 814889, 170652, 21272, 911567, 180075, 706453, 469966, 515095, 93090, 972562, 162587, 382528, 135270, 137527, 65395, 773540, 916033, 432874, 75035, 993526, 439715, 606919, 947861, 795089, 683259, 698370, 991693, 440152, 492648, 762356, 901542, 314605, 437478, 544278, 708501, 742927, 826138, 53033, 405592, 308437, 832635, 154543, 577190, 802244, 550509, 371448, 406462, 219024, 416924, 289491, 886016, 961607, 173599, 617886, 43146, 870084, 156990, 586596, 656088, 131117, 916728, 659394, 318884, 597270, 75532, 435071, 757293, 588155, 2395, 621737, 72227, 10064, 164948, 759882, 233833, 613101, 360107, 753743, 760038, 510667, 401783, 90913, 854566, 488303, 407893, 940594, 103064, 341305, 320297, 737299, 984074, 341451, 602349, 816863, 703311, 853208, 245951, 13876, 110802, 83218, 273585, 400508, 650311, 675898, 103351, 47356, 795687, 371693, 65057, 957791, 559519, 290648, 118321, 645381, 198342, 691144, 392626, 651445, 732465, 88741, 100881, 324264, 20258, 54198, 683430, 663870, 789564, 424050, 445109, 544906, 669549, 910184, 971750, 346977, 373410, 287388, 58631, 964018, 345149, 369731, 750120, 409430, 78313, 831366, 203177, 43768, 822715, 638808, 84078, 716323, 709795, 329365, 373709, 294495, 644868, 249288, 773645, 863862, 368110, 829215, 790585, 878798, 858714, 618500, 707792, 584552, 417696, 923809, 462187, 351921, 604817, 213153, 125789, 987390, 905733, 955801, 2932, 124623, 207751, 597737, 40510, 50084, 388339, 456445, 980679, 156742, 976366, 691822, 599552, 294660, 904345, 982801, 380365, 505404, 964699, 924150, 619304, 505995, 235354, 946421, 607981, 496575, 460603, 734771, 428742, 483678, 398382, 231091, 906368, 207310, 508187, 161200, 49077, 632603, 962138, 617116, 935491, 58057, 190347, 686536, 47224, 709475, 278422, 246483, 67382, 20610, 699295, 106076, 102406, 37326, 672398, 905822, 489179, 377490, 111997, 114897, 705579, 568004, 867084, 966172, 340731, 176051, 813005, 87385, 882562, 530183, 13651, 107968, 299288, 833913, 969691, 619770, 453490, 272332, 812831, 462269, 129512, 264247, 857887, 387827, 218513, 183900, 829792, 478893, 400394, 17576, 445030, 185498, 443246, 382949, 948359, 392625, 72716, 197136, 246564, 398258, 392090, 199975, 644412, 251305, 580446, 640601, 102437, 723261, 835904, 201225, 858990, 510162, 234708, 790980, 81, 761931, 60344, 76146, 699144, 430382, 111149, 551102, 321450, 621163, 841651, 421390, 264206, 334624, 166053, 584921, 856878, 966169, 841387, 608564, 51917, 662103, 635977, 955092, 533106, 827588, 494139, 513866, 551425, 700047, 298784, 534969, 689767, 577466, 764215, 550677, 205660, 816815, 544069, 338126, 592241, 42069, 182915, 807399, 566417, 719342, 8133, 324389, 897757, 889058, 408495, 931815, 28019, 900376, 605755, 333986, 327537, 368020, 828969, 916177, 751890, 35729, 746341, 54714, 310790, 771489, 629188, 675562, 967251, 649251, 17915, 719903, 318917, 786760, 265454, 740017, 393589, 537164, 268192, 105167, 206809, 804738, 134815, 67957, 135015, 663517, 781332, 527906, 316245, 481291, 113187, 209096, 569345, 381543, 25082, 729111, 586903, 488866, 563639, 190577, 854791, 204704, 795645] [288, 457, 415, 33, 18, 397, 324, 193, 340, 109, 199, 291, 440, 160, 47, 140, 366, 106, 441, 25, 240, 402, 148, 245, 81, 342, 153, 174, 302, 198, 238, 208, 363, 108, 205, 66, 427, 312, 142, 8, 276, 159, 460, 248, 39, 231, 380, 300, 264, 460, 476, 107, 493, 34, 213, 46, 31, 110, 30, 49, 328, 10, 331, 355, 405, 452, 86, 362, 160, 191, 126, 452, 238, 200, 482, 472, 75, 385, 155, 99, 275, 115, 1, 120, 171, 363, 390, 333, 11, 485, 264, 449, 483, 37, 242, 377, 433, 74, 302, 263, 387, 381, 328, 56, 230, 309, 445, 52, 239, 107, 38, 449, 74, 186, 432, 352, 132, 416, 231, 69, 469, 85, 481, 393, 139, 118, 50, 124, 305, 366, 162, 295, 417, 458, 272, 472, 232, 466, 316, 359, 161, 342, 313, 87, 338, 446, 59, 247, 426, 131, 54, 312, 262, 98, 326, 284, 167, 20, 394, 23, 11, 176, 95, 390, 103, 195, 341, 470, 355, 333, 336, 68, 379, 57, 447, 127, 170, 240, 423, 346, 403, 375, 395, 74, 34, 64, 309, 48, 67, 62, 173, 369, 79, 312, 235, 270, 274, 20, 148, 282, 288, 347, 430, 180, 12, 33, 139, 450, 238, 410, 330, 481, 337, 310, 357, 439, 236, 395, 451, 313, 69, 384, 438, 126, 213, 68, 329, 349, 310, 223, 38, 146, 6, 188, 188, 100, 384, 248, 269, 481, 179, 401, 90, 433, 395, 233, 237, 481, 330, 171, 145, 338, 126, 119, 297, 14, 138, 381, 316, 38, 27, 63, 305, 203, 493, 430, 458, 39, 389, 355, 333, 316, 68, 254, 332, 76, 52, 19, 490, 378, 359, 289, 351, 199, 438, 241, 492, 244, 324, 62, 31, 486, 27, 226, 261, 377, 33, 475, 350, 238, 58, 407, 434, 174, 350, 86, 258, 371, 413, 49, 126, 307, 41, 136, 76, 257, 467, 189, 369, 459, 12, 45, 94, 29, 99, 443, 423, 87, 95, 280, 29, 398, 237, 449, 50, 37, 469, 285, 12, 160, 97, 65, 332, 14, 37, 283, 316, 75, 121, 366, 413, 274, 250, 483, 491, 461, 296, 331, 328, 239, 172, 217, 468, 395, 225, 254, 151, 48, 241, 335, 440, 255, 442, 2, 10, 370, 277, 296, 416, 226, 170, 287, 487, 417, 391, 100, 154, 250, 66, 320, 319, 308, 331, 409, 310, 432, 258, 356, 3, 98, 324, 428, 135, 460, 148, 222, 206, 296, 190, 319, 426, 70, 188, 34, 489, 61, 470, 315, 387, 26, 72, 116, 388, 274, 216, 123, 26, 18, 493, 380, 181, 137, 302, 36, 257, 12, 229, 475, 126, 112, 123, 417, 37, 375, 426, 395, 381, 248, 345, 22, 323, 50, 195, 429, 375, 320, 176, 136, 382, 26, 81, 25, 488, 140, 324, 477, 25, 473, 133, 202, 260, 432, 254, 241, 110, 425, 71, 77, 466, 121, 36, 136, 405, 477, 309, 421, 102, 212, 324]))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (paintWalls [319489, 378880, 781463, 939141, 148353, 925755, 201773, 349674, 785379, 936841, 562281, 985348, 118832, 883600, 702057, 11182, 961384, 388633, 980144, 400874, 392416, 401973, 769752, 244678, 4660, 668787, 983683, 153571, 772451, 618225, 624035, 836647, 219106, 721200, 71020, 361835, 121972, 837145, 67254, 219233, 496663, 798113, 641485, 238168, 716436, 959482, 655705, 489619, 797047, 402322, 904498, 39224, 680966, 894052, 598744, 437820, 255741, 714810, 818212, 279021, 735523, 947302, 682585, 159951, 689543, 672094, 479413, 193472, 271173, 398463, 671002, 111195, 772986, 530877, 747092, 622385, 258973, 647279, 1560, 230654, 410591, 616972, 458032, 280611, 91924, 586572, 182047, 131470, 106753, 791100, 153029, 492394, 267715, 916611, 750808, 529611, 634699, 573388, 269222, 957413, 327702, 935686, 140353, 846069, 648580, 52685, 988999, 47619, 32439, 848933, 408922, 766183, 342126, 761199, 961015, 234643, 477560, 916219, 40810, 981333, 969545, 755569, 993713, 523817, 413491, 879601, 725635, 235533, 717575, 633788, 297386, 905060, 204166, 983165, 453317, 974112, 435161, 945793, 989415, 252894, 60885, 614578, 570243, 647477, 677795, 129480, 913347, 714492, 45892, 37107, 819722, 705733, 808228, 424001, 572334, 497223, 234669, 624080, 30768, 370986, 273904, 37572, 79753, 455734, 343873, 523567, 202244, 575353, 668731, 808061, 380901, 975013, 631502, 161592, 588952, 375463, 712379, 161222, 850024, 31159, 342198, 546062, 944561, 705291, 230847, 224333, 860677, 650773, 150624, 353229, 952513, 213927, 670201, 504903, 767049, 81018, 949093, 300644, 611674, 667114, 925532, 218560, 924426, 302672, 265346, 205395, 851981, 431768, 694303, 145514, 680039, 406155, 602087, 588, 256946, 434768, 619627, 20374, 974051, 152600, 540306, 695162, 209830, 259998, 563664, 772076, 106123, 521262, 314605, 788109, 442322, 791237, 590906, 413966, 169370, 927235, 56858, 601709, 47197, 216043, 132462, 786160, 650789, 688244, 269989, 329346, 386792, 518901, 503229, 150675, 248511, 405817, 883588, 74437, 693075, 282787, 333898, 771554, 170881, 832752, 81058, 743886, 710555, 823449, 330207, 293216, 989441, 483125, 205570, 992521, 167407, 666967, 334537, 163370, 788124, 438473, 49112, 181100, 441247, 977434, 882554, 268577, 865785, 981759, 192970, 552428, 634432, 895627, 827728, 40659, 969279, 716147, 87867, 546368, 415019, 665338, 140224, 721710, 107262, 356262, 218887, 818235, 832681, 499471, 592517, 236674, 550451, 712113, 958827, 433542, 979717, 664454, 974469, 636997, 11721, 389233, 451774, 989193, 155045, 315986, 421903, 266718, 44313, 835203, 212142, 154299, 276282, 821113, 306126, 368525, 165093, 773275, 345512, 352021, 767600, 750264, 681708, 486179, 154576, 613476, 722995, 615564, 592515, 634034, 325775, 302406, 854865, 52845, 17947, 655230, 986338, 882018, 180302, 611843, 945801, 21566, 995355, 327907, 905083, 432087, 945958, 649543, 671374, 326935, 744547, 806327, 789525, 856598, 487401, 128900, 713593, 585680, 283688, 159756, 836039, 868130, 539953, 219179, 520484, 738834, 203393, 564241, 177269, 955313, 468120, 662749, 110899, 916269, 853908, 745369, 439906, 504328, 896961, 743052, 655126, 900048, 340548, 326119, 408603, 458074, 227952, 109242, 354788, 721900, 99097, 673446, 306125, 963758, 56467, 142667, 481968, 843458, 470408, 769577, 600879, 244900, 302468, 798657, 366429, 703504, 25231, 987316, 689891, 458596, 217387, 502556, 788319, 511280, 360320, 965051, 747393] [102, 465, 81, 106, 191, 195, 13, 71, 213, 313, 224, 196, 450, 426, 214, 468, 88, 426, 420, 231, 122, 213, 427, 440, 327, 217, 60, 271, 469, 127, 489, 113, 87, 117, 200, 465, 79, 491, 236, 341, 252, 225, 55, 196, 25, 467, 324, 498, 330, 55, 404, 177, 388, 403, 174, 111, 453, 393, 287, 333, 271, 246, 445, 426, 126, 116, 487, 97, 20, 143, 213, 45, 253, 94, 75, 150, 32, 346, 249, 245, 63, 2, 312, 365, 277, 495, 168, 55, 105, 406, 72, 198, 283, 316, 479, 15, 380, 433, 124, 53, 298, 158, 267, 60, 439, 72, 144, 203, 318, 55, 277, 131, 266, 3, 148, 263, 229, 173, 277, 497, 154, 295, 225, 7, 278, 237, 316, 261, 355, 200, 317, 483, 259, 238, 150, 348, 131, 376, 391, 257, 417, 88, 341, 435, 272, 324, 135, 48, 357, 325, 23, 101, 325, 163, 58, 294, 33, 208, 236, 332, 349, 428, 108, 180, 211, 81, 464, 233, 320, 308, 399, 299, 330, 55, 56, 415, 268, 406, 380, 289, 93, 322, 345, 125, 28, 500, 37, 134, 23, 243, 437, 294, 483, 123, 412, 168, 207, 52, 148, 423, 365, 284, 237, 222, 52, 61, 458, 29, 352, 306, 243, 462, 499, 34, 236, 216, 37, 454, 175, 2, 351, 217, 462, 275, 321, 470, 217, 249, 360, 107, 141, 430, 156, 181, 37, 284, 254, 131, 312, 79, 32, 279, 445, 11, 290, 336, 133, 96, 62, 388, 155, 65, 37, 81, 200, 493, 404, 308, 450, 212, 440, 152, 99, 290, 217, 494, 2, 432, 198, 164, 467, 296, 423, 396, 27, 486, 125, 392, 151, 114, 357, 161, 378, 472, 442, 302, 114, 200, 441, 93, 496, 478, 321, 371, 41, 179, 265, 246, 237, 359, 99, 12, 263, 208, 194, 239, 318, 360, 457, 387, 14, 148, 307, 200, 377, 77, 417, 325, 112, 386, 13, 13, 273, 466, 185, 141, 308, 260, 145, 153, 131, 194, 378, 41, 142, 70, 117, 34, 359, 382, 324, 223, 383, 458, 357, 177, 463, 245, 57, 216, 411, 144, 419, 321, 71, 129, 221, 359, 156, 155, 187, 74, 209, 217, 92, 375, 277, 335, 316, 45, 483, 371, 221, 12, 79, 69, 130, 487, 450, 163, 12, 309, 452, 372, 425, 331, 301, 70, 221, 237, 457, 377, 411, 179, 128, 247, 464, 411, 379, 179, 180, 234, 481, 287, 353, 31, 400, 385, 251, 9, 239, 185, 497, 373, 389, 281, 153, 352, 387, 221, 425, 268, 25, 149, 327, 216, 260, 246, 190, 378, 275])," 6220 (paintWalls [319489, 378880, 781463, 939141, 148353, 925755, 201773, 349674, 785379, 936841, 562281, 985348, 118832, 883600, 702057, 11182, 961384, 388633, 980144, 400874, 392416, 401973, 769752, 244678, 4660, 668787, 983683, 153571, 772451, 618225, 624035, 836647, 219106, 721200, 71020, 361835, 121972, 837145, 67254, 219233, 496663, 798113, 641485, 238168, 716436, 959482, 655705, 489619, 797047, 402322, 904498, 39224, 680966, 894052, 598744, 437820, 255741, 714810, 818212, 279021, 735523, 947302, 682585, 159951, 689543, 672094, 479413, 193472, 271173, 398463, 671002, 111195, 772986, 530877, 747092, 622385, 258973, 647279, 1560, 230654, 410591, 616972, 458032, 280611, 91924, 586572, 182047, 131470, 106753, 791100, 153029, 492394, 267715, 916611, 750808, 529611, 634699, 573388, 269222, 957413, 327702, 935686, 140353, 846069, 648580, 52685, 988999, 47619, 32439, 848933, 408922, 766183, 342126, 761199, 961015, 234643, 477560, 916219, 40810, 981333, 969545, 755569, 993713, 523817, 413491, 879601, 725635, 235533, 717575, 633788, 297386, 905060, 204166, 983165, 453317, 974112, 435161, 945793, 989415, 252894, 60885, 614578, 570243, 647477, 677795, 129480, 913347, 714492, 45892, 37107, 819722, 705733, 808228, 424001, 572334, 497223, 234669, 624080, 30768, 370986, 273904, 37572, 79753, 455734, 343873, 523567, 202244, 575353, 668731, 808061, 380901, 975013, 631502, 161592, 588952, 375463, 712379, 161222, 850024, 31159, 342198, 546062, 944561, 705291, 230847, 224333, 860677, 650773, 150624, 353229, 952513, 213927, 670201, 504903, 767049, 81018, 949093, 300644, 611674, 667114, 925532, 218560, 924426, 302672, 265346, 205395, 851981, 431768, 694303, 145514, 680039, 406155, 602087, 588, 256946, 434768, 619627, 20374, 974051, 152600, 540306, 695162, 209830, 259998, 563664, 772076, 106123, 521262, 314605, 788109, 442322, 791237, 590906, 413966, 169370, 927235, 56858, 601709, 47197, 216043, 132462, 786160, 650789, 688244, 269989, 329346, 386792, 518901, 503229, 150675, 248511, 405817, 883588, 74437, 693075, 282787, 333898, 771554, 170881, 832752, 81058, 743886, 710555, 823449, 330207, 293216, 989441, 483125, 205570, 992521, 167407, 666967, 334537, 163370, 788124, 438473, 49112, 181100, 441247, 977434, 882554, 268577, 865785, 981759, 192970, 552428, 634432, 895627, 827728, 40659, 969279, 716147, 87867, 546368, 415019, 665338, 140224, 721710, 107262, 356262, 218887, 818235, 832681, 499471, 592517, 236674, 550451, 712113, 958827, 433542, 979717, 664454, 974469, 636997, 11721, 389233, 451774, 989193, 155045, 315986, 421903, 266718, 44313, 835203, 212142, 154299, 276282, 821113, 306126, 368525, 165093, 773275, 345512, 352021, 767600, 750264, 681708, 486179, 154576, 613476, 722995, 615564, 592515, 634034, 325775, 302406, 854865, 52845, 17947, 655230, 986338, 882018, 180302, 611843, 945801, 21566, 995355, 327907, 905083, 432087, 945958, 649543, 671374, 326935, 744547, 806327, 789525, 856598, 487401, 128900, 713593, 585680, 283688, 159756, 836039, 868130, 539953, 219179, 520484, 738834, 203393, 564241, 177269, 955313, 468120, 662749, 110899, 916269, 853908, 745369, 439906, 504328, 896961, 743052, 655126, 900048, 340548, 326119, 408603, 458074, 227952, 109242, 354788, 721900, 99097, 673446, 306125, 963758, 56467, 142667, 481968, 843458, 470408, 769577, 600879, 244900, 302468, 798657, 366429, 703504, 25231, 987316, 689891, 458596, 217387, 502556, 788319, 511280, 360320, 965051, 747393] [102, 465, 81, 106, 191, 195, 13, 71, 213, 313, 224, 196, 450, 426, 214, 468, 88, 426, 420, 231, 122, 213, 427, 440, 327, 217, 60, 271, 469, 127, 489, 113, 87, 117, 200, 465, 79, 491, 236, 341, 252, 225, 55, 196, 25, 467, 324, 498, 330, 55, 404, 177, 388, 403, 174, 111, 453, 393, 287, 333, 271, 246, 445, 426, 126, 116, 487, 97, 20, 143, 213, 45, 253, 94, 75, 150, 32, 346, 249, 245, 63, 2, 312, 365, 277, 495, 168, 55, 105, 406, 72, 198, 283, 316, 479, 15, 380, 433, 124, 53, 298, 158, 267, 60, 439, 72, 144, 203, 318, 55, 277, 131, 266, 3, 148, 263, 229, 173, 277, 497, 154, 295, 225, 7, 278, 237, 316, 261, 355, 200, 317, 483, 259, 238, 150, 348, 131, 376, 391, 257, 417, 88, 341, 435, 272, 324, 135, 48, 357, 325, 23, 101, 325, 163, 58, 294, 33, 208, 236, 332, 349, 428, 108, 180, 211, 81, 464, 233, 320, 308, 399, 299, 330, 55, 56, 415, 268, 406, 380, 289, 93, 322, 345, 125, 28, 500, 37, 134, 23, 243, 437, 294, 483, 123, 412, 168, 207, 52, 148, 423, 365, 284, 237, 222, 52, 61, 458, 29, 352, 306, 243, 462, 499, 34, 236, 216, 37, 454, 175, 2, 351, 217, 462, 275, 321, 470, 217, 249, 360, 107, 141, 430, 156, 181, 37, 284, 254, 131, 312, 79, 32, 279, 445, 11, 290, 336, 133, 96, 62, 388, 155, 65, 37, 81, 200, 493, 404, 308, 450, 212, 440, 152, 99, 290, 217, 494, 2, 432, 198, 164, 467, 296, 423, 396, 27, 486, 125, 392, 151, 114, 357, 161, 378, 472, 442, 302, 114, 200, 441, 93, 496, 478, 321, 371, 41, 179, 265, 246, 237, 359, 99, 12, 263, 208, 194, 239, 318, 360, 457, 387, 14, 148, 307, 200, 377, 77, 417, 325, 112, 386, 13, 13, 273, 466, 185, 141, 308, 260, 145, 153, 131, 194, 378, 41, 142, 70, 117, 34, 359, 382, 324, 223, 383, 458, 357, 177, 463, 245, 57, 216, 411, 144, 419, 321, 71, 129, 221, 359, 156, 155, 187, 74, 209, 217, 92, 375, 277, 335, 316, 45, 483, 371, 221, 12, 79, 69, 130, 487, 450, 163, 12, 309, 452, 372, 425, 331, 301, 70, 221, 237, 457, 377, 411, 179, 128, 247, 464, 411, 379, 179, 180, 234, 481, 287, 353, 31, 400, 385, 251, 9, 239, 185, 497, 373, 389, 281, 153, 352, 387, 221, 425, 268, 25, 149, 327, 216, 260, 246, 190, 378, 275]))
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
painting_the_walls/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, paintWalls(new ArrayList<>(Arrays.asList(1,2,3,2)), new ArrayList<>(Arrays.asList(1,2,3,2))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(4, paintWalls(new ArrayList<>(Arrays.asList(2,3,4,2)), new ArrayList<>(Arrays.asList(1,1,1,1))));
19
+ }
20
+
21
+ }
painting_the_walls/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
painting_the_walls/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 (paintWalls [1;2;3;2] [1;2;3;2])
12
+
13
+ let test2 _ = assert_equal 4 (paintWalls [2;3;4;2] [1;1;1;1])
14
+
15
+ let test3 _ = assert_equal 5104 (paintWalls [268643; 752013; 318161; 524677; 374576; 71970; 869505; 753435; 713518; 555757; 432948; 39983; 919949; 998079; 743129; 632026; 954321; 86066; 487112; 219176; 526603; 707334; 847105; 844438; 662067; 134805; 97818; 579412; 839247; 646698; 219873; 591959; 963949; 368585; 860097; 995546; 607846; 794911; 341445; 566022; 226895; 724644; 214879; 1224; 125133; 631015; 349852; 947247; 165023; 580195; 7821; 731000; 524780; 71120; 233463; 840417; 756273; 504263; 376014; 536514; 257219; 590802; 615186; 318017; 721816; 75727; 259781; 834518; 446513; 650293; 51585; 287106; 148135; 643831; 336710; 472402; 525148; 736766; 654887; 702024; 977224; 534789; 524642; 387706; 692517; 571525; 939096; 164256; 63828; 703658; 806005; 452115; 10093; 161712; 269827; 395792; 6388; 340843; 903234; 21804; 655074; 968151; 713861; 764184; 753589; 131157; 706735; 186618; 253999; 375799; 274504; 58355; 853990; 788371; 87125; 37646; 535702; 399072; 954288; 571946; 908174; 47192; 167639; 930987; 567730; 769180; 952783; 5104; 37700; 749527; 329309; 636215; 645541; 868987; 214681; 69876; 153598; 546001; 910316; 232998; 429262; 833199; 215902; 692400; 37338; 210426; 429757; 188895; 71745; 491429; 985882; 407873; 705374; 696411; 94483; 983842; 299451; 114047; 957948; 220421; 536487; 657446; 299160; 237534; 413175; 831359; 534403; 503757; 428862; 491142; 933802; 45408; 495984; 216287; 22281; 312069; 297321; 998372; 801067; 453947; 254632; 227422; 78780; 217526; 599246; 116704; 748265; 922753; 978512; 474290; 384912; 841481; 780530; 840285; 549211; 226337; 489835; 803716; 498851; 991346; 268561; 797339; 110448; 929171; 865408; 225606; 972804; 430652; 436186; 862140; 372258; 933431; 720598; 901910; 674953; 249997; 271784; 733756; 211323; 274067; 705862; 676353; 686812; 709634; 55379; 517632; 328622; 679798; 826822; 596440; 188536; 997377; 598642; 652474; 682295; 7392; 456962; 27696; 969305; 724757; 288412; 348399; 670232; 121396; 675422; 664409; 469005; 206405; 945464; 66504; 643527; 745406; 790754; 811590; 511994; 487778; 359376; 944804; 709979; 93876; 784462; 54152; 968032; 278407; 293901; 373199; 833798; 59173; 15748; 731829; 559825; 985302; 639013; 106196; 730480; 584668; 135533; 80031; 551554; 637390; 995410; 261960; 496932; 410176; 361604; 963798; 806467; 543085; 229218; 547445; 252242; 619774; 749657; 63719; 891703; 485297; 832433; 132769; 627085; 938083; 453512; 570305; 341200; 575882; 154468; 190979; 350680; 284335; 177392; 901085] [131; 44; 371; 455; 257; 472; 218; 173; 191; 229; 58; 370; 404; 258; 99; 4; 342; 25; 239; 284; 93; 446; 299; 109; 286; 434; 472; 55; 99; 346; 356; 279; 240; 352; 284; 49; 427; 120; 484; 319; 20; 182; 25; 49; 227; 439; 451; 187; 228; 499; 470; 240; 87; 116; 155; 462; 407; 354; 106; 219; 386; 421; 14; 109; 315; 17; 335; 499; 318; 178; 500; 78; 309; 25; 403; 104; 84; 328; 244; 368; 410; 28; 204; 15; 497; 238; 82; 166; 114; 323; 55; 419; 40; 14; 160; 162; 48; 374; 79; 479; 125; 277; 139; 190; 362; 365; 5; 319; 17; 101; 49; 374; 426; 267; 303; 25; 257; 139; 48; 17; 351; 150; 314; 224; 439; 278; 140; 350; 295; 460; 133; 329; 56; 21; 13; 258; 395; 234; 65; 234; 258; 219; 500; 310; 51; 332; 13; 400; 263; 129; 375; 168; 88; 450; 376; 95; 394; 209; 120; 214; 404; 437; 395; 19; 301; 476; 500; 422; 234; 454; 235; 156; 376; 93; 39; 323; 126; 495; 214; 477; 498; 184; 265; 69; 302; 10; 279; 121; 400; 387; 212; 475; 143; 367; 215; 341; 155; 270; 177; 244; 43; 129; 405; 339; 464; 253; 66; 392; 139; 130; 492; 465; 110; 313; 90; 480; 141; 453; 295; 83; 218; 261; 372; 203; 211; 497; 68; 309; 407; 292; 76; 280; 432; 53; 448; 380; 26; 183; 88; 298; 15; 296; 119; 193; 324; 241; 102; 72; 16; 149; 251; 140; 45; 233; 430; 459; 77; 69; 101; 135; 234; 495; 342; 267; 158; 167; 312; 29; 124; 421; 483; 81; 487; 99; 349; 141; 298; 309; 252; 274; 5; 40; 41; 404; 458; 221; 249; 204; 413; 131; 328; 114; 127; 414; 487; 381; 49; 258; 166; 383; 330; 224; 147; 80; 480; 300; 199; 436; 69; 349])
16
+
17
+ let test4 _ = assert_equal 11964 (paintWalls [631329; 506660; 874006; 401735; 430561; 164160; 733867; 138222; 156550; 808780; 985691; 657587; 454859; 26589; 286211; 316886; 690358; 852726; 534985; 74133; 739358; 244539; 482883; 933540; 548468; 762765; 649239; 322588; 941345; 333442; 827161; 902433; 361815; 664147; 464517; 684981; 793801; 451318; 649211; 86156; 662848; 862040; 960861; 59335; 893175; 317614; 536319; 377137; 16431; 124016; 11964; 303335; 940093; 515074; 403052; 32856; 14421; 681882; 637736; 42382; 857659; 829788; 207282; 512718; 153297; 899340; 657254; 379387; 581472; 825855; 945933; 977553; 86675] [335; 9; 355; 469; 231; 55; 197; 474; 369; 174; 46; 420; 228; 432; 301; 311; 410; 346; 420; 70; 485; 436; 66; 424; 300; 12; 350; 294; 484; 191; 334; 137; 179; 343; 192; 471; 366; 389; 466; 80; 280; 8; 380; 387; 477; 290; 235; 215; 458; 206; 167; 202; 353; 143; 190; 383; 179; 290; 416; 499; 275; 482; 418; 445; 23; 432; 364; 174; 328; 67; 396; 78; 490])
18
+
19
+ let test5 _ = assert_equal 23058 (paintWalls [383062; 295970; 824925; 593850; 70562; 86341; 730776; 323615; 206218; 841019; 172809; 256030; 645635; 561442; 832083; 381521; 521692; 322999; 55224; 56026; 412442; 128659; 734069; 534423; 709414; 466526; 452666; 494189; 351898; 498833; 991296; 735113; 145223; 319188; 474687; 23058; 794685; 953924; 96220; 457219; 342148; 260003; 978641; 76385; 411956; 76487; 714636; 408791; 43997; 41801; 322982; 313679; 300810; 262792; 509510; 853117; 579646; 181960; 929370; 884642; 188650; 452775; 227232; 911617; 711394; 938681; 389824; 172997; 34325; 263032; 455947; 422537; 873813; 183891] [405; 407; 156; 137; 320; 474; 421; 149; 379; 420; 191; 117; 401; 60; 148; 442; 319; 71; 342; 321; 404; 88; 379; 129; 446; 143; 467; 137; 439; 143; 11; 411; 307; 125; 146; 253; 311; 265; 485; 233; 299; 194; 257; 397; 31; 478; 111; 115; 195; 465; 48; 9; 342; 261; 344; 38; 286; 492; 351; 195; 259; 309; 2; 120; 475; 353; 412; 370; 373; 401; 263; 205; 339; 23])
20
+
21
+ let test6 _ = assert_equal 856 (paintWalls [703636; 708634; 94980; 40938; 577470; 696595; 333731; 191081; 130543; 280587; 743484; 350460; 177591; 119594; 899495; 91410; 520442; 19573; 56790; 289610; 957950; 681849; 178275; 549135; 855718; 162166; 480042; 914072; 786134; 317091; 414645; 440592; 474075; 187627; 474718; 941088; 753537; 842721; 72238; 462069; 523685; 682520; 649446; 828422; 746014; 712180; 592078; 207488; 957481; 310062; 311152; 393331; 780577; 814475; 967048; 185844; 542782; 92429; 317513; 460350; 469782; 273335; 190099; 963286; 868173; 535911; 135438; 811289; 691443; 436123; 799031; 225912; 856; 972731; 615004; 635663; 479735; 423684; 899147; 622261; 446432; 391433; 428920; 105526; 997659; 313946; 454822; 834248; 65923; 650857; 134599; 930902; 767630; 143051; 669083; 861559; 12442; 854383; 979161; 989971; 144166; 750275; 280174; 349808; 29171; 534216; 682826; 154459; 626607; 2915; 470449; 496691; 7149; 514111; 746199; 782023; 378189; 742696; 961321; 441206; 879003; 125149; 403849; 654448; 677184; 312963; 907463; 730371; 504032; 60724; 871098; 959021; 906540; 706134; 257493; 935158; 109960; 518053; 796164; 869334; 303056; 531442; 747726; 159305; 826973; 956003; 11162; 65194; 96674; 696589; 132105; 995657; 28654; 470485; 643755; 492043; 176175; 131153; 609855; 3143; 593633; 589661; 414208; 704162; 878078; 487526; 891675; 91392; 666687; 340781; 694941; 461988; 556951; 449758; 851100; 402512; 145446; 640228; 929739; 252262; 529654; 554985; 240895; 444965; 837768; 277757; 765348; 961463; 315516; 909247; 576292; 592910; 213030; 513372; 933734; 605587; 815508; 485787; 60036; 612464; 980139; 297509; 910462; 647252; 351849; 95741; 259906; 629712; 618124; 995448; 599321; 163048; 945205; 339538; 426754; 242137; 900491; 233626; 641026; 342219; 747182; 237345; 308701; 533601; 16381; 470248; 969107; 235522; 56202; 78555; 251863; 927067; 918320; 297920; 505067; 949842; 157647; 877581; 875557; 384513; 601165; 840913; 79459; 758914; 511220; 536350; 185485; 105499; 852067; 855141; 584368; 134164; 17540; 467504; 188353; 715011; 661262; 105074; 935596; 965107; 285662; 927299; 558537; 31161; 307713] [5; 342; 334; 292; 207; 165; 484; 88; 344; 227; 209; 371; 365; 445; 231; 41; 250; 249; 30; 154; 389; 481; 380; 23; 135; 35; 203; 340; 413; 223; 348; 185; 248; 183; 337; 113; 438; 76; 154; 36; 241; 483; 471; 229; 319; 288; 86; 23; 274; 262; 336; 416; 4; 245; 355; 379; 51; 76; 115; 234; 94; 421; 133; 74; 66; 348; 58; 314; 317; 6; 463; 473; 475; 105; 212; 470; 35; 285; 448; 468; 101; 114; 128; 413; 118; 268; 421; 257; 377; 47; 391; 227; 320; 430; 311; 254; 193; 76; 115; 325; 183; 417; 200; 285; 408; 212; 358; 187; 491; 370; 179; 493; 284; 137; 325; 364; 213; 164; 370; 52; 58; 500; 151; 78; 262; 467; 277; 15; 366; 309; 418; 375; 482; 146; 274; 236; 13; 197; 459; 53; 238; 399; 181; 421; 125; 289; 186; 222; 410; 107; 400; 214; 66; 286; 278; 206; 6; 166; 208; 288; 337; 140; 487; 5; 331; 258; 64; 138; 218; 481; 92; 312; 249; 94; 284; 3; 360; 298; 84; 298; 48; 383; 346; 73; 304; 341; 454; 384; 169; 28; 184; 471; 86; 228; 31; 364; 18; 241; 300; 149; 201; 327; 500; 405; 402; 256; 143; 13; 9; 231; 308; 23; 198; 158; 196; 357; 286; 466; 33; 128; 283; 47; 235; 339; 19; 293; 102; 331; 286; 323; 301; 378; 478; 489; 145; 289; 348; 395; 29; 428; 34; 72; 80; 287; 373; 72; 491; 271; 71; 426; 139; 215; 240; 276; 374; 465; 46; 150; 54; 141; 34; 462; 390; 263; 140])
22
+
23
+ let test7 _ = assert_equal 6102 (paintWalls [196386; 515278; 487523; 572433; 823844; 868848; 210915; 984051; 20744; 143583; 711988; 111364; 891432; 87302; 638169; 518912; 230503; 421630; 493829; 215949; 588405; 500819; 368210; 493304; 504549; 447332; 620438; 113584; 939469; 459996; 258059; 125145; 11230; 841719; 548600; 683642; 40062; 753346; 123307; 423429; 707124; 811387; 167263; 16219; 318283; 50396; 955842; 463103; 209153; 390201; 818263; 539815; 874791; 414568; 415482; 162566; 523543; 751162; 55546; 416736; 328224; 296521; 20819; 230588; 832248; 941589; 41728; 19856; 574428; 824532; 148708; 565872; 935863; 933044; 304521; 731639; 96667; 998617; 456973; 55607; 434306; 927311; 114018; 265751; 120417; 531679; 758998; 575631; 880764; 287305; 772931; 667170; 668484; 602548; 967150; 966595; 236038; 874434; 90356; 441488; 872239; 427715; 427814; 975891; 316107; 706206; 864261; 617549; 918129; 467314; 569743; 613661; 961359; 414982; 757567; 524437; 538579; 191132; 836552; 988856; 735461; 928256; 541449; 111647; 763615; 95629; 959484; 180078; 657378; 401607; 482430; 712398; 37890; 140115; 946153; 55111; 382299; 428515; 275117; 475686; 992883; 487829; 105799; 515137; 923658; 242664; 31463; 419336; 915770; 901223; 763301; 936899; 493776; 441390; 867949; 165577; 349149; 123750; 90392; 569723; 516379; 243677; 541086; 290840; 387176; 654384; 798559; 134312; 846097; 159971; 274779; 486304; 674969; 492387; 6655; 12796; 680802; 918899; 286355; 731544; 304365; 228883; 214665; 468434; 56100; 226998; 48068; 135624; 490077; 166702; 264919; 690315; 454653; 626249; 316911; 403409; 676425; 726402; 693462; 948476; 3458; 620880; 270213; 314996; 649593; 166258; 408021; 611914; 249070; 849760; 366452; 471193; 228365; 834070; 770049; 974222; 835291; 230008; 183141; 304003; 891071; 433346; 747621; 567098; 426127; 990315; 691608; 894598; 803772; 412710; 717223; 350610; 492018; 776090; 427154; 792988; 274518; 782535; 928893; 305552; 408379; 755700; 808297; 536286; 253443; 307235; 511986; 152741; 882930; 766079; 962725; 720283; 694200; 552526; 114318; 711552; 962232; 955828; 44259; 35623; 980636; 361234; 487118; 719585; 901046; 889323; 49772; 844541; 56201; 990335; 999145; 637794; 105791; 32872; 667802; 51469; 206472; 443272; 45738; 634654; 303810; 910244; 894205; 921083; 10955; 737568; 540681; 882298; 127727; 126297; 23469; 6102; 695396; 70223; 711714; 904931; 606455; 91878; 191869; 7411; 752051; 844182; 323449; 483215; 238406; 520834; 853454; 781399; 96077; 476266; 522534; 863813; 743010; 732344; 350589; 269207; 439151; 287897; 935619; 571399; 832074; 170220; 206113; 243127; 418201; 761054; 63681; 109316; 171172; 960285; 668508; 32749; 441014; 828373; 243092; 88390; 472126; 994820; 230849; 54855; 770656; 163530; 246048; 128335] [492; 35; 154; 466; 211; 428; 209; 39; 143; 255; 345; 404; 145; 232; 107; 162; 255; 311; 68; 283; 286; 394; 185; 484; 178; 456; 157; 95; 263; 234; 432; 471; 362; 98; 422; 456; 444; 339; 29; 354; 444; 31; 217; 173; 258; 3; 157; 114; 372; 31; 245; 349; 109; 217; 131; 229; 35; 231; 356; 3; 495; 310; 257; 316; 288; 354; 66; 307; 282; 50; 419; 89; 102; 343; 73; 423; 277; 326; 167; 48; 419; 164; 103; 393; 316; 226; 221; 110; 199; 272; 135; 82; 7; 339; 387; 189; 240; 216; 323; 403; 81; 252; 33; 426; 413; 364; 63; 468; 54; 245; 467; 372; 466; 451; 253; 246; 115; 316; 82; 64; 389; 351; 198; 484; 269; 48; 134; 185; 76; 34; 56; 421; 476; 368; 309; 241; 334; 180; 99; 241; 360; 493; 409; 399; 315; 354; 102; 217; 445; 136; 288; 498; 232; 111; 131; 140; 33; 57; 452; 27; 118; 32; 475; 339; 87; 464; 409; 314; 293; 283; 153; 332; 444; 485; 178; 151; 408; 317; 149; 367; 244; 103; 4; 278; 470; 62; 18; 374; 471; 323; 440; 309; 82; 362; 45; 226; 32; 403; 387; 9; 87; 38; 303; 123; 406; 205; 275; 438; 218; 416; 364; 484; 353; 79; 263; 418; 324; 126; 465; 321; 412; 375; 195; 353; 108; 474; 9; 465; 45; 109; 212; 200; 103; 161; 367; 25; 433; 487; 48; 32; 83; 464; 262; 241; 274; 261; 118; 212; 362; 422; 141; 5; 117; 202; 361; 273; 185; 160; 109; 348; 240; 270; 178; 390; 203; 267; 461; 476; 411; 433; 236; 407; 55; 84; 393; 447; 440; 31; 132; 479; 132; 85; 418; 100; 358; 477; 194; 452; 371; 215; 314; 440; 356; 404; 437; 497; 58; 207; 421; 90; 164; 145; 410; 350; 284; 280; 392; 322; 222; 467; 244; 84; 38; 219; 410; 94; 195; 268; 485; 498; 71; 226; 247; 195; 487; 411; 38; 324; 1; 120; 304; 181; 78; 472; 95; 256; 299; 206; 378; 291; 299; 499; 42; 271])
24
+
25
+ let test8 _ = assert_equal 10145 (paintWalls [542932; 176748; 528763; 723496; 205229; 569602; 855413; 252409; 451644; 752515; 391378; 552141; 918526; 608397; 790351; 547393; 36987; 399333; 693449; 507850; 257562; 957301; 80124; 46962; 617075; 738660; 739606; 208005; 245619; 999747; 926465; 857235; 32314; 151653; 403719; 129163; 111217; 247632; 989445; 70773; 798094; 119830; 857546; 768177; 469061; 593438; 192602; 793793; 983811; 527957; 471132; 332839; 578695; 625665; 539311; 709077; 508455; 898232; 497152; 557317; 304355; 491761; 149263; 291055; 543057; 909762; 286684; 209263; 809584; 643006; 248488; 480365; 481572; 665681; 602314; 779717; 297994; 790629; 133977; 91611; 26589; 363499; 489816; 867966; 322271; 142219; 663326; 952428; 509719; 435273; 623918; 44859; 550995; 408929; 837041; 287107; 814889; 170652; 21272; 911567; 180075; 706453; 469966; 515095; 93090; 972562; 162587; 382528; 135270; 137527; 65395; 773540; 916033; 432874; 75035; 993526; 439715; 606919; 947861; 795089; 683259; 698370; 991693; 440152; 492648; 762356; 901542; 314605; 437478; 544278; 708501; 742927; 826138; 53033; 405592; 308437; 832635; 154543; 577190; 802244; 550509; 371448; 406462; 219024; 416924; 289491; 886016; 961607; 173599; 617886; 43146; 870084; 156990; 586596; 656088; 131117; 916728; 659394; 318884; 597270; 75532; 435071; 757293; 588155; 2395; 621737; 72227; 10064; 164948; 759882; 233833; 613101; 360107; 753743; 760038; 510667; 401783; 90913; 854566; 488303; 407893; 940594; 103064; 341305; 320297; 737299; 984074; 341451; 602349; 816863; 703311; 853208; 245951; 13876; 110802; 83218; 273585; 400508; 650311; 675898; 103351; 47356; 795687; 371693; 65057; 957791; 559519; 290648; 118321; 645381; 198342; 691144; 392626; 651445; 732465; 88741; 100881; 324264; 20258; 54198; 683430; 663870; 789564; 424050; 445109; 544906; 669549; 910184; 971750; 346977; 373410; 287388; 58631; 964018; 345149; 369731; 750120; 409430; 78313; 831366; 203177; 43768; 822715; 638808; 84078; 716323; 709795; 329365; 373709; 294495; 644868; 249288; 773645; 863862; 368110; 829215; 790585; 878798; 858714; 618500; 707792; 584552; 417696; 923809; 462187; 351921; 604817; 213153; 125789; 987390; 905733; 955801; 2932; 124623; 207751; 597737; 40510; 50084; 388339; 456445; 980679; 156742; 976366; 691822; 599552; 294660; 904345; 982801; 380365; 505404; 964699; 924150; 619304; 505995; 235354; 946421; 607981; 496575; 460603; 734771; 428742; 483678; 398382; 231091; 906368; 207310; 508187; 161200; 49077; 632603; 962138; 617116; 935491; 58057; 190347; 686536; 47224; 709475; 278422; 246483; 67382; 20610; 699295; 106076; 102406; 37326; 672398; 905822; 489179; 377490; 111997; 114897; 705579; 568004; 867084; 966172; 340731; 176051; 813005; 87385; 882562; 530183; 13651; 107968; 299288; 833913; 969691; 619770; 453490; 272332; 812831; 462269; 129512; 264247; 857887; 387827; 218513; 183900; 829792; 478893; 400394; 17576; 445030; 185498; 443246; 382949; 948359; 392625; 72716; 197136; 246564; 398258; 392090; 199975; 644412; 251305; 580446; 640601; 102437; 723261; 835904; 201225; 858990; 510162; 234708; 790980; 81; 761931; 60344; 76146; 699144; 430382; 111149; 551102; 321450; 621163; 841651; 421390; 264206; 334624; 166053; 584921; 856878; 966169; 841387; 608564; 51917; 662103; 635977; 955092; 533106; 827588; 494139; 513866; 551425; 700047; 298784; 534969; 689767; 577466; 764215; 550677; 205660; 816815; 544069; 338126; 592241; 42069; 182915; 807399; 566417; 719342; 8133; 324389; 897757; 889058; 408495; 931815; 28019; 900376; 605755; 333986; 327537; 368020; 828969; 916177; 751890; 35729; 746341; 54714; 310790; 771489; 629188; 675562; 967251; 649251; 17915; 719903; 318917; 786760; 265454; 740017; 393589; 537164; 268192; 105167; 206809; 804738; 134815; 67957; 135015; 663517; 781332; 527906; 316245; 481291; 113187; 209096; 569345; 381543; 25082; 729111; 586903; 488866; 563639; 190577; 854791; 204704; 795645] [288; 457; 415; 33; 18; 397; 324; 193; 340; 109; 199; 291; 440; 160; 47; 140; 366; 106; 441; 25; 240; 402; 148; 245; 81; 342; 153; 174; 302; 198; 238; 208; 363; 108; 205; 66; 427; 312; 142; 8; 276; 159; 460; 248; 39; 231; 380; 300; 264; 460; 476; 107; 493; 34; 213; 46; 31; 110; 30; 49; 328; 10; 331; 355; 405; 452; 86; 362; 160; 191; 126; 452; 238; 200; 482; 472; 75; 385; 155; 99; 275; 115; 1; 120; 171; 363; 390; 333; 11; 485; 264; 449; 483; 37; 242; 377; 433; 74; 302; 263; 387; 381; 328; 56; 230; 309; 445; 52; 239; 107; 38; 449; 74; 186; 432; 352; 132; 416; 231; 69; 469; 85; 481; 393; 139; 118; 50; 124; 305; 366; 162; 295; 417; 458; 272; 472; 232; 466; 316; 359; 161; 342; 313; 87; 338; 446; 59; 247; 426; 131; 54; 312; 262; 98; 326; 284; 167; 20; 394; 23; 11; 176; 95; 390; 103; 195; 341; 470; 355; 333; 336; 68; 379; 57; 447; 127; 170; 240; 423; 346; 403; 375; 395; 74; 34; 64; 309; 48; 67; 62; 173; 369; 79; 312; 235; 270; 274; 20; 148; 282; 288; 347; 430; 180; 12; 33; 139; 450; 238; 410; 330; 481; 337; 310; 357; 439; 236; 395; 451; 313; 69; 384; 438; 126; 213; 68; 329; 349; 310; 223; 38; 146; 6; 188; 188; 100; 384; 248; 269; 481; 179; 401; 90; 433; 395; 233; 237; 481; 330; 171; 145; 338; 126; 119; 297; 14; 138; 381; 316; 38; 27; 63; 305; 203; 493; 430; 458; 39; 389; 355; 333; 316; 68; 254; 332; 76; 52; 19; 490; 378; 359; 289; 351; 199; 438; 241; 492; 244; 324; 62; 31; 486; 27; 226; 261; 377; 33; 475; 350; 238; 58; 407; 434; 174; 350; 86; 258; 371; 413; 49; 126; 307; 41; 136; 76; 257; 467; 189; 369; 459; 12; 45; 94; 29; 99; 443; 423; 87; 95; 280; 29; 398; 237; 449; 50; 37; 469; 285; 12; 160; 97; 65; 332; 14; 37; 283; 316; 75; 121; 366; 413; 274; 250; 483; 491; 461; 296; 331; 328; 239; 172; 217; 468; 395; 225; 254; 151; 48; 241; 335; 440; 255; 442; 2; 10; 370; 277; 296; 416; 226; 170; 287; 487; 417; 391; 100; 154; 250; 66; 320; 319; 308; 331; 409; 310; 432; 258; 356; 3; 98; 324; 428; 135; 460; 148; 222; 206; 296; 190; 319; 426; 70; 188; 34; 489; 61; 470; 315; 387; 26; 72; 116; 388; 274; 216; 123; 26; 18; 493; 380; 181; 137; 302; 36; 257; 12; 229; 475; 126; 112; 123; 417; 37; 375; 426; 395; 381; 248; 345; 22; 323; 50; 195; 429; 375; 320; 176; 136; 382; 26; 81; 25; 488; 140; 324; 477; 25; 473; 133; 202; 260; 432; 254; 241; 110; 425; 71; 77; 466; 121; 36; 136; 405; 477; 309; 421; 102; 212; 324])
26
+
27
+ let test9 _ = assert_equal 6220 (paintWalls [319489; 378880; 781463; 939141; 148353; 925755; 201773; 349674; 785379; 936841; 562281; 985348; 118832; 883600; 702057; 11182; 961384; 388633; 980144; 400874; 392416; 401973; 769752; 244678; 4660; 668787; 983683; 153571; 772451; 618225; 624035; 836647; 219106; 721200; 71020; 361835; 121972; 837145; 67254; 219233; 496663; 798113; 641485; 238168; 716436; 959482; 655705; 489619; 797047; 402322; 904498; 39224; 680966; 894052; 598744; 437820; 255741; 714810; 818212; 279021; 735523; 947302; 682585; 159951; 689543; 672094; 479413; 193472; 271173; 398463; 671002; 111195; 772986; 530877; 747092; 622385; 258973; 647279; 1560; 230654; 410591; 616972; 458032; 280611; 91924; 586572; 182047; 131470; 106753; 791100; 153029; 492394; 267715; 916611; 750808; 529611; 634699; 573388; 269222; 957413; 327702; 935686; 140353; 846069; 648580; 52685; 988999; 47619; 32439; 848933; 408922; 766183; 342126; 761199; 961015; 234643; 477560; 916219; 40810; 981333; 969545; 755569; 993713; 523817; 413491; 879601; 725635; 235533; 717575; 633788; 297386; 905060; 204166; 983165; 453317; 974112; 435161; 945793; 989415; 252894; 60885; 614578; 570243; 647477; 677795; 129480; 913347; 714492; 45892; 37107; 819722; 705733; 808228; 424001; 572334; 497223; 234669; 624080; 30768; 370986; 273904; 37572; 79753; 455734; 343873; 523567; 202244; 575353; 668731; 808061; 380901; 975013; 631502; 161592; 588952; 375463; 712379; 161222; 850024; 31159; 342198; 546062; 944561; 705291; 230847; 224333; 860677; 650773; 150624; 353229; 952513; 213927; 670201; 504903; 767049; 81018; 949093; 300644; 611674; 667114; 925532; 218560; 924426; 302672; 265346; 205395; 851981; 431768; 694303; 145514; 680039; 406155; 602087; 588; 256946; 434768; 619627; 20374; 974051; 152600; 540306; 695162; 209830; 259998; 563664; 772076; 106123; 521262; 314605; 788109; 442322; 791237; 590906; 413966; 169370; 927235; 56858; 601709; 47197; 216043; 132462; 786160; 650789; 688244; 269989; 329346; 386792; 518901; 503229; 150675; 248511; 405817; 883588; 74437; 693075; 282787; 333898; 771554; 170881; 832752; 81058; 743886; 710555; 823449; 330207; 293216; 989441; 483125; 205570; 992521; 167407; 666967; 334537; 163370; 788124; 438473; 49112; 181100; 441247; 977434; 882554; 268577; 865785; 981759; 192970; 552428; 634432; 895627; 827728; 40659; 969279; 716147; 87867; 546368; 415019; 665338; 140224; 721710; 107262; 356262; 218887; 818235; 832681; 499471; 592517; 236674; 550451; 712113; 958827; 433542; 979717; 664454; 974469; 636997; 11721; 389233; 451774; 989193; 155045; 315986; 421903; 266718; 44313; 835203; 212142; 154299; 276282; 821113; 306126; 368525; 165093; 773275; 345512; 352021; 767600; 750264; 681708; 486179; 154576; 613476; 722995; 615564; 592515; 634034; 325775; 302406; 854865; 52845; 17947; 655230; 986338; 882018; 180302; 611843; 945801; 21566; 995355; 327907; 905083; 432087; 945958; 649543; 671374; 326935; 744547; 806327; 789525; 856598; 487401; 128900; 713593; 585680; 283688; 159756; 836039; 868130; 539953; 219179; 520484; 738834; 203393; 564241; 177269; 955313; 468120; 662749; 110899; 916269; 853908; 745369; 439906; 504328; 896961; 743052; 655126; 900048; 340548; 326119; 408603; 458074; 227952; 109242; 354788; 721900; 99097; 673446; 306125; 963758; 56467; 142667; 481968; 843458; 470408; 769577; 600879; 244900; 302468; 798657; 366429; 703504; 25231; 987316; 689891; 458596; 217387; 502556; 788319; 511280; 360320; 965051; 747393] [102; 465; 81; 106; 191; 195; 13; 71; 213; 313; 224; 196; 450; 426; 214; 468; 88; 426; 420; 231; 122; 213; 427; 440; 327; 217; 60; 271; 469; 127; 489; 113; 87; 117; 200; 465; 79; 491; 236; 341; 252; 225; 55; 196; 25; 467; 324; 498; 330; 55; 404; 177; 388; 403; 174; 111; 453; 393; 287; 333; 271; 246; 445; 426; 126; 116; 487; 97; 20; 143; 213; 45; 253; 94; 75; 150; 32; 346; 249; 245; 63; 2; 312; 365; 277; 495; 168; 55; 105; 406; 72; 198; 283; 316; 479; 15; 380; 433; 124; 53; 298; 158; 267; 60; 439; 72; 144; 203; 318; 55; 277; 131; 266; 3; 148; 263; 229; 173; 277; 497; 154; 295; 225; 7; 278; 237; 316; 261; 355; 200; 317; 483; 259; 238; 150; 348; 131; 376; 391; 257; 417; 88; 341; 435; 272; 324; 135; 48; 357; 325; 23; 101; 325; 163; 58; 294; 33; 208; 236; 332; 349; 428; 108; 180; 211; 81; 464; 233; 320; 308; 399; 299; 330; 55; 56; 415; 268; 406; 380; 289; 93; 322; 345; 125; 28; 500; 37; 134; 23; 243; 437; 294; 483; 123; 412; 168; 207; 52; 148; 423; 365; 284; 237; 222; 52; 61; 458; 29; 352; 306; 243; 462; 499; 34; 236; 216; 37; 454; 175; 2; 351; 217; 462; 275; 321; 470; 217; 249; 360; 107; 141; 430; 156; 181; 37; 284; 254; 131; 312; 79; 32; 279; 445; 11; 290; 336; 133; 96; 62; 388; 155; 65; 37; 81; 200; 493; 404; 308; 450; 212; 440; 152; 99; 290; 217; 494; 2; 432; 198; 164; 467; 296; 423; 396; 27; 486; 125; 392; 151; 114; 357; 161; 378; 472; 442; 302; 114; 200; 441; 93; 496; 478; 321; 371; 41; 179; 265; 246; 237; 359; 99; 12; 263; 208; 194; 239; 318; 360; 457; 387; 14; 148; 307; 200; 377; 77; 417; 325; 112; 386; 13; 13; 273; 466; 185; 141; 308; 260; 145; 153; 131; 194; 378; 41; 142; 70; 117; 34; 359; 382; 324; 223; 383; 458; 357; 177; 463; 245; 57; 216; 411; 144; 419; 321; 71; 129; 221; 359; 156; 155; 187; 74; 209; 217; 92; 375; 277; 335; 316; 45; 483; 371; 221; 12; 79; 69; 130; 487; 450; 163; 12; 309; 452; 372; 425; 331; 301; 70; 221; 237; 457; 377; 411; 179; 128; 247; 464; 411; 379; 179; 180; 234; 481; 287; 353; 31; 400; 385; 251; 9; 239; 185; 497; 373; 389; 281; 153; 352; 387; 221; 425; 268; 25; 149; 327; 216; 260; 246; 190; 378; 275])
28
+
29
+ let test10 _ = assert_equal 26819 (paintWalls [4060; 559836; 412974; 237614; 467812; 394271; 868873; 489389; 38554; 517520; 352957; 141959; 426589; 711472; 395011; 592043; 844357; 587576; 436846; 828848; 833391; 307317; 159736; 369923; 546947; 125995; 598835; 358970; 617159; 130239; 825910; 406938; 940700; 626835; 422296; 390237; 708096; 620417; 92310; 683088; 107354; 657184; 756522; 854914; 992600; 352404; 330552; 797730; 719877; 169596; 609008; 589260; 382901; 306837; 151478; 69515; 186412; 420261; 274073; 157411; 248076; 619926; 934059; 198563; 182280; 561117; 868892; 638264; 990384; 39125; 470562; 210021; 996444; 519693; 711428; 907137; 562032; 997581; 537023; 462553; 626500; 979117; 782452; 910921; 243227; 762723; 564298; 204067; 525204; 447635; 410584; 22759; 907452; 202123; 663220; 841913; 491248; 864823; 500016; 719592; 458071; 965126; 927997; 416997; 526329; 368590; 559581; 386807; 950204; 851416; 875532; 439040; 879172; 374286; 441466; 440020; 365818; 96082; 176210; 132196; 28850; 54217; 180862; 964984; 622124; 566793; 223172; 264111; 51588; 246205; 332389; 983490; 798596; 34435; 325826; 126076; 79091; 45653; 434404; 530972; 910980; 454164; 719266; 220902; 187892; 949080; 730125; 132745; 301486; 660706; 204228; 367590; 781649; 588188; 407547; 189250; 91611; 316033; 728828; 950364; 57093; 652168; 215037; 974796; 577420; 173397; 881282; 772933; 975894; 667337; 387535; 937280; 994880; 195705; 967864; 589873; 578961; 876328; 926533; 9467; 303764; 852914; 159124; 953328; 91342; 233817; 278630; 877416; 71342; 562499; 607080; 173666; 364015; 115110; 732517; 49480; 613729; 315687; 183529; 193175; 563195; 673154; 551386; 375305; 832712; 923841; 399873; 944347; 823270; 125446; 780812; 306445; 415015; 662298; 735035; 66592; 275236; 16187; 181948; 919636; 399188; 847199; 963872; 777634; 81049; 957549; 953132; 400596; 969396; 408787; 675530; 497745; 926288; 751863; 840413; 174776; 900500; 284811; 623726; 365676; 338807; 638616; 774270; 222421; 227487; 288140; 846435; 50992; 878832; 944007; 951591; 246924; 969050; 304090; 215441; 494940; 245183; 828482; 10924; 354411; 30930; 688853; 31839; 209769; 373951; 531348; 363880; 383208; 765894; 479419; 430864; 167924; 846174; 428562; 661391; 623773; 476830; 386354; 465624; 962954; 178154; 470986; 923876; 770211; 703110; 895952; 83247; 208689; 385285; 337169; 726488; 209259; 445374; 480739; 62868; 289304; 245238; 174825; 743832] [45; 355; 390; 338; 5; 366; 395; 459; 90; 413; 49; 406; 320; 167; 369; 360; 408; 401; 282; 153; 184; 383; 145; 474; 347; 239; 7; 251; 231; 163; 300; 348; 282; 312; 258; 259; 105; 496; 118; 71; 109; 212; 331; 480; 445; 383; 280; 108; 491; 367; 334; 357; 247; 318; 114; 171; 371; 456; 158; 267; 218; 172; 113; 123; 378; 363; 397; 482; 442; 238; 339; 426; 454; 386; 413; 491; 247; 428; 465; 78; 16; 163; 96; 413; 56; 136; 178; 288; 181; 9; 400; 278; 266; 474; 122; 120; 337; 218; 163; 10; 403; 175; 144; 354; 275; 179; 63; 491; 408; 334; 185; 116; 321; 328; 498; 480; 477; 15; 437; 17; 362; 218; 220; 392; 370; 334; 439; 179; 77; 102; 231; 496; 62; 119; 358; 206; 182; 152; 489; 346; 209; 332; 152; 478; 431; 109; 105; 138; 369; 34; 59; 323; 389; 499; 205; 1; 477; 282; 426; 320; 176; 29; 496; 42; 395; 144; 289; 144; 191; 174; 59; 211; 311; 433; 62; 305; 214; 321; 462; 129; 95; 318; 496; 45; 275; 60; 205; 134; 457; 23; 243; 80; 324; 372; 278; 131; 209; 386; 49; 335; 269; 434; 55; 37; 29; 223; 185; 138; 162; 344; 113; 352; 225; 444; 91; 178; 428; 106; 235; 410; 43; 40; 207; 16; 96; 25; 220; 157; 429; 343; 310; 476; 17; 342; 30; 404; 251; 452; 382; 304; 6; 39; 407; 137; 328; 191; 341; 358; 99; 264; 467; 270; 332; 118; 323; 489; 403; 91; 18; 279; 249; 69; 331; 70; 326; 188; 174; 342; 397; 179; 246; 206; 34; 36; 439; 487; 79; 130; 211; 465; 12; 268; 122; 441; 149; 83; 95; 168; 90; 437; 121; 382; 419; 98; 117; 188; 367; 136; 222])
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for paintWalls" >::: [
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
painting_the_walls/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.paintWalls(List(1,2,3,2),List(1,2,3,2)), 3)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.paintWalls(List(2,3,4,2),List(1,1,1,1)), 4)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.paintWalls(List(268643, 752013, 318161, 524677, 374576, 71970, 869505, 753435, 713518, 555757, 432948, 39983, 919949, 998079, 743129, 632026, 954321, 86066, 487112, 219176, 526603, 707334, 847105, 844438, 662067, 134805, 97818, 579412, 839247, 646698, 219873, 591959, 963949, 368585, 860097, 995546, 607846, 794911, 341445, 566022, 226895, 724644, 214879, 1224, 125133, 631015, 349852, 947247, 165023, 580195, 7821, 731000, 524780, 71120, 233463, 840417, 756273, 504263, 376014, 536514, 257219, 590802, 615186, 318017, 721816, 75727, 259781, 834518, 446513, 650293, 51585, 287106, 148135, 643831, 336710, 472402, 525148, 736766, 654887, 702024, 977224, 534789, 524642, 387706, 692517, 571525, 939096, 164256, 63828, 703658, 806005, 452115, 10093, 161712, 269827, 395792, 6388, 340843, 903234, 21804, 655074, 968151, 713861, 764184, 753589, 131157, 706735, 186618, 253999, 375799, 274504, 58355, 853990, 788371, 87125, 37646, 535702, 399072, 954288, 571946, 908174, 47192, 167639, 930987, 567730, 769180, 952783, 5104, 37700, 749527, 329309, 636215, 645541, 868987, 214681, 69876, 153598, 546001, 910316, 232998, 429262, 833199, 215902, 692400, 37338, 210426, 429757, 188895, 71745, 491429, 985882, 407873, 705374, 696411, 94483, 983842, 299451, 114047, 957948, 220421, 536487, 657446, 299160, 237534, 413175, 831359, 534403, 503757, 428862, 491142, 933802, 45408, 495984, 216287, 22281, 312069, 297321, 998372, 801067, 453947, 254632, 227422, 78780, 217526, 599246, 116704, 748265, 922753, 978512, 474290, 384912, 841481, 780530, 840285, 549211, 226337, 489835, 803716, 498851, 991346, 268561, 797339, 110448, 929171, 865408, 225606, 972804, 430652, 436186, 862140, 372258, 933431, 720598, 901910, 674953, 249997, 271784, 733756, 211323, 274067, 705862, 676353, 686812, 709634, 55379, 517632, 328622, 679798, 826822, 596440, 188536, 997377, 598642, 652474, 682295, 7392, 456962, 27696, 969305, 724757, 288412, 348399, 670232, 121396, 675422, 664409, 469005, 206405, 945464, 66504, 643527, 745406, 790754, 811590, 511994, 487778, 359376, 944804, 709979, 93876, 784462, 54152, 968032, 278407, 293901, 373199, 833798, 59173, 15748, 731829, 559825, 985302, 639013, 106196, 730480, 584668, 135533, 80031, 551554, 637390, 995410, 261960, 496932, 410176, 361604, 963798, 806467, 543085, 229218, 547445, 252242, 619774, 749657, 63719, 891703, 485297, 832433, 132769, 627085, 938083, 453512, 570305, 341200, 575882, 154468, 190979, 350680, 284335, 177392, 901085),List(131, 44, 371, 455, 257, 472, 218, 173, 191, 229, 58, 370, 404, 258, 99, 4, 342, 25, 239, 284, 93, 446, 299, 109, 286, 434, 472, 55, 99, 346, 356, 279, 240, 352, 284, 49, 427, 120, 484, 319, 20, 182, 25, 49, 227, 439, 451, 187, 228, 499, 470, 240, 87, 116, 155, 462, 407, 354, 106, 219, 386, 421, 14, 109, 315, 17, 335, 499, 318, 178, 500, 78, 309, 25, 403, 104, 84, 328, 244, 368, 410, 28, 204, 15, 497, 238, 82, 166, 114, 323, 55, 419, 40, 14, 160, 162, 48, 374, 79, 479, 125, 277, 139, 190, 362, 365, 5, 319, 17, 101, 49, 374, 426, 267, 303, 25, 257, 139, 48, 17, 351, 150, 314, 224, 439, 278, 140, 350, 295, 460, 133, 329, 56, 21, 13, 258, 395, 234, 65, 234, 258, 219, 500, 310, 51, 332, 13, 400, 263, 129, 375, 168, 88, 450, 376, 95, 394, 209, 120, 214, 404, 437, 395, 19, 301, 476, 500, 422, 234, 454, 235, 156, 376, 93, 39, 323, 126, 495, 214, 477, 498, 184, 265, 69, 302, 10, 279, 121, 400, 387, 212, 475, 143, 367, 215, 341, 155, 270, 177, 244, 43, 129, 405, 339, 464, 253, 66, 392, 139, 130, 492, 465, 110, 313, 90, 480, 141, 453, 295, 83, 218, 261, 372, 203, 211, 497, 68, 309, 407, 292, 76, 280, 432, 53, 448, 380, 26, 183, 88, 298, 15, 296, 119, 193, 324, 241, 102, 72, 16, 149, 251, 140, 45, 233, 430, 459, 77, 69, 101, 135, 234, 495, 342, 267, 158, 167, 312, 29, 124, 421, 483, 81, 487, 99, 349, 141, 298, 309, 252, 274, 5, 40, 41, 404, 458, 221, 249, 204, 413, 131, 328, 114, 127, 414, 487, 381, 49, 258, 166, 383, 330, 224, 147, 80, 480, 300, 199, 436, 69, 349)), 5104)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.paintWalls(List(631329, 506660, 874006, 401735, 430561, 164160, 733867, 138222, 156550, 808780, 985691, 657587, 454859, 26589, 286211, 316886, 690358, 852726, 534985, 74133, 739358, 244539, 482883, 933540, 548468, 762765, 649239, 322588, 941345, 333442, 827161, 902433, 361815, 664147, 464517, 684981, 793801, 451318, 649211, 86156, 662848, 862040, 960861, 59335, 893175, 317614, 536319, 377137, 16431, 124016, 11964, 303335, 940093, 515074, 403052, 32856, 14421, 681882, 637736, 42382, 857659, 829788, 207282, 512718, 153297, 899340, 657254, 379387, 581472, 825855, 945933, 977553, 86675),List(335, 9, 355, 469, 231, 55, 197, 474, 369, 174, 46, 420, 228, 432, 301, 311, 410, 346, 420, 70, 485, 436, 66, 424, 300, 12, 350, 294, 484, 191, 334, 137, 179, 343, 192, 471, 366, 389, 466, 80, 280, 8, 380, 387, 477, 290, 235, 215, 458, 206, 167, 202, 353, 143, 190, 383, 179, 290, 416, 499, 275, 482, 418, 445, 23, 432, 364, 174, 328, 67, 396, 78, 490)), 11964)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.paintWalls(List(383062, 295970, 824925, 593850, 70562, 86341, 730776, 323615, 206218, 841019, 172809, 256030, 645635, 561442, 832083, 381521, 521692, 322999, 55224, 56026, 412442, 128659, 734069, 534423, 709414, 466526, 452666, 494189, 351898, 498833, 991296, 735113, 145223, 319188, 474687, 23058, 794685, 953924, 96220, 457219, 342148, 260003, 978641, 76385, 411956, 76487, 714636, 408791, 43997, 41801, 322982, 313679, 300810, 262792, 509510, 853117, 579646, 181960, 929370, 884642, 188650, 452775, 227232, 911617, 711394, 938681, 389824, 172997, 34325, 263032, 455947, 422537, 873813, 183891),List(405, 407, 156, 137, 320, 474, 421, 149, 379, 420, 191, 117, 401, 60, 148, 442, 319, 71, 342, 321, 404, 88, 379, 129, 446, 143, 467, 137, 439, 143, 11, 411, 307, 125, 146, 253, 311, 265, 485, 233, 299, 194, 257, 397, 31, 478, 111, 115, 195, 465, 48, 9, 342, 261, 344, 38, 286, 492, 351, 195, 259, 309, 2, 120, 475, 353, 412, 370, 373, 401, 263, 205, 339, 23)), 23058)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.paintWalls(List(703636, 708634, 94980, 40938, 577470, 696595, 333731, 191081, 130543, 280587, 743484, 350460, 177591, 119594, 899495, 91410, 520442, 19573, 56790, 289610, 957950, 681849, 178275, 549135, 855718, 162166, 480042, 914072, 786134, 317091, 414645, 440592, 474075, 187627, 474718, 941088, 753537, 842721, 72238, 462069, 523685, 682520, 649446, 828422, 746014, 712180, 592078, 207488, 957481, 310062, 311152, 393331, 780577, 814475, 967048, 185844, 542782, 92429, 317513, 460350, 469782, 273335, 190099, 963286, 868173, 535911, 135438, 811289, 691443, 436123, 799031, 225912, 856, 972731, 615004, 635663, 479735, 423684, 899147, 622261, 446432, 391433, 428920, 105526, 997659, 313946, 454822, 834248, 65923, 650857, 134599, 930902, 767630, 143051, 669083, 861559, 12442, 854383, 979161, 989971, 144166, 750275, 280174, 349808, 29171, 534216, 682826, 154459, 626607, 2915, 470449, 496691, 7149, 514111, 746199, 782023, 378189, 742696, 961321, 441206, 879003, 125149, 403849, 654448, 677184, 312963, 907463, 730371, 504032, 60724, 871098, 959021, 906540, 706134, 257493, 935158, 109960, 518053, 796164, 869334, 303056, 531442, 747726, 159305, 826973, 956003, 11162, 65194, 96674, 696589, 132105, 995657, 28654, 470485, 643755, 492043, 176175, 131153, 609855, 3143, 593633, 589661, 414208, 704162, 878078, 487526, 891675, 91392, 666687, 340781, 694941, 461988, 556951, 449758, 851100, 402512, 145446, 640228, 929739, 252262, 529654, 554985, 240895, 444965, 837768, 277757, 765348, 961463, 315516, 909247, 576292, 592910, 213030, 513372, 933734, 605587, 815508, 485787, 60036, 612464, 980139, 297509, 910462, 647252, 351849, 95741, 259906, 629712, 618124, 995448, 599321, 163048, 945205, 339538, 426754, 242137, 900491, 233626, 641026, 342219, 747182, 237345, 308701, 533601, 16381, 470248, 969107, 235522, 56202, 78555, 251863, 927067, 918320, 297920, 505067, 949842, 157647, 877581, 875557, 384513, 601165, 840913, 79459, 758914, 511220, 536350, 185485, 105499, 852067, 855141, 584368, 134164, 17540, 467504, 188353, 715011, 661262, 105074, 935596, 965107, 285662, 927299, 558537, 31161, 307713),List(5, 342, 334, 292, 207, 165, 484, 88, 344, 227, 209, 371, 365, 445, 231, 41, 250, 249, 30, 154, 389, 481, 380, 23, 135, 35, 203, 340, 413, 223, 348, 185, 248, 183, 337, 113, 438, 76, 154, 36, 241, 483, 471, 229, 319, 288, 86, 23, 274, 262, 336, 416, 4, 245, 355, 379, 51, 76, 115, 234, 94, 421, 133, 74, 66, 348, 58, 314, 317, 6, 463, 473, 475, 105, 212, 470, 35, 285, 448, 468, 101, 114, 128, 413, 118, 268, 421, 257, 377, 47, 391, 227, 320, 430, 311, 254, 193, 76, 115, 325, 183, 417, 200, 285, 408, 212, 358, 187, 491, 370, 179, 493, 284, 137, 325, 364, 213, 164, 370, 52, 58, 500, 151, 78, 262, 467, 277, 15, 366, 309, 418, 375, 482, 146, 274, 236, 13, 197, 459, 53, 238, 399, 181, 421, 125, 289, 186, 222, 410, 107, 400, 214, 66, 286, 278, 206, 6, 166, 208, 288, 337, 140, 487, 5, 331, 258, 64, 138, 218, 481, 92, 312, 249, 94, 284, 3, 360, 298, 84, 298, 48, 383, 346, 73, 304, 341, 454, 384, 169, 28, 184, 471, 86, 228, 31, 364, 18, 241, 300, 149, 201, 327, 500, 405, 402, 256, 143, 13, 9, 231, 308, 23, 198, 158, 196, 357, 286, 466, 33, 128, 283, 47, 235, 339, 19, 293, 102, 331, 286, 323, 301, 378, 478, 489, 145, 289, 348, 395, 29, 428, 34, 72, 80, 287, 373, 72, 491, 271, 71, 426, 139, 215, 240, 276, 374, 465, 46, 150, 54, 141, 34, 462, 390, 263, 140)), 856)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.paintWalls(List(196386, 515278, 487523, 572433, 823844, 868848, 210915, 984051, 20744, 143583, 711988, 111364, 891432, 87302, 638169, 518912, 230503, 421630, 493829, 215949, 588405, 500819, 368210, 493304, 504549, 447332, 620438, 113584, 939469, 459996, 258059, 125145, 11230, 841719, 548600, 683642, 40062, 753346, 123307, 423429, 707124, 811387, 167263, 16219, 318283, 50396, 955842, 463103, 209153, 390201, 818263, 539815, 874791, 414568, 415482, 162566, 523543, 751162, 55546, 416736, 328224, 296521, 20819, 230588, 832248, 941589, 41728, 19856, 574428, 824532, 148708, 565872, 935863, 933044, 304521, 731639, 96667, 998617, 456973, 55607, 434306, 927311, 114018, 265751, 120417, 531679, 758998, 575631, 880764, 287305, 772931, 667170, 668484, 602548, 967150, 966595, 236038, 874434, 90356, 441488, 872239, 427715, 427814, 975891, 316107, 706206, 864261, 617549, 918129, 467314, 569743, 613661, 961359, 414982, 757567, 524437, 538579, 191132, 836552, 988856, 735461, 928256, 541449, 111647, 763615, 95629, 959484, 180078, 657378, 401607, 482430, 712398, 37890, 140115, 946153, 55111, 382299, 428515, 275117, 475686, 992883, 487829, 105799, 515137, 923658, 242664, 31463, 419336, 915770, 901223, 763301, 936899, 493776, 441390, 867949, 165577, 349149, 123750, 90392, 569723, 516379, 243677, 541086, 290840, 387176, 654384, 798559, 134312, 846097, 159971, 274779, 486304, 674969, 492387, 6655, 12796, 680802, 918899, 286355, 731544, 304365, 228883, 214665, 468434, 56100, 226998, 48068, 135624, 490077, 166702, 264919, 690315, 454653, 626249, 316911, 403409, 676425, 726402, 693462, 948476, 3458, 620880, 270213, 314996, 649593, 166258, 408021, 611914, 249070, 849760, 366452, 471193, 228365, 834070, 770049, 974222, 835291, 230008, 183141, 304003, 891071, 433346, 747621, 567098, 426127, 990315, 691608, 894598, 803772, 412710, 717223, 350610, 492018, 776090, 427154, 792988, 274518, 782535, 928893, 305552, 408379, 755700, 808297, 536286, 253443, 307235, 511986, 152741, 882930, 766079, 962725, 720283, 694200, 552526, 114318, 711552, 962232, 955828, 44259, 35623, 980636, 361234, 487118, 719585, 901046, 889323, 49772, 844541, 56201, 990335, 999145, 637794, 105791, 32872, 667802, 51469, 206472, 443272, 45738, 634654, 303810, 910244, 894205, 921083, 10955, 737568, 540681, 882298, 127727, 126297, 23469, 6102, 695396, 70223, 711714, 904931, 606455, 91878, 191869, 7411, 752051, 844182, 323449, 483215, 238406, 520834, 853454, 781399, 96077, 476266, 522534, 863813, 743010, 732344, 350589, 269207, 439151, 287897, 935619, 571399, 832074, 170220, 206113, 243127, 418201, 761054, 63681, 109316, 171172, 960285, 668508, 32749, 441014, 828373, 243092, 88390, 472126, 994820, 230849, 54855, 770656, 163530, 246048, 128335),List(492, 35, 154, 466, 211, 428, 209, 39, 143, 255, 345, 404, 145, 232, 107, 162, 255, 311, 68, 283, 286, 394, 185, 484, 178, 456, 157, 95, 263, 234, 432, 471, 362, 98, 422, 456, 444, 339, 29, 354, 444, 31, 217, 173, 258, 3, 157, 114, 372, 31, 245, 349, 109, 217, 131, 229, 35, 231, 356, 3, 495, 310, 257, 316, 288, 354, 66, 307, 282, 50, 419, 89, 102, 343, 73, 423, 277, 326, 167, 48, 419, 164, 103, 393, 316, 226, 221, 110, 199, 272, 135, 82, 7, 339, 387, 189, 240, 216, 323, 403, 81, 252, 33, 426, 413, 364, 63, 468, 54, 245, 467, 372, 466, 451, 253, 246, 115, 316, 82, 64, 389, 351, 198, 484, 269, 48, 134, 185, 76, 34, 56, 421, 476, 368, 309, 241, 334, 180, 99, 241, 360, 493, 409, 399, 315, 354, 102, 217, 445, 136, 288, 498, 232, 111, 131, 140, 33, 57, 452, 27, 118, 32, 475, 339, 87, 464, 409, 314, 293, 283, 153, 332, 444, 485, 178, 151, 408, 317, 149, 367, 244, 103, 4, 278, 470, 62, 18, 374, 471, 323, 440, 309, 82, 362, 45, 226, 32, 403, 387, 9, 87, 38, 303, 123, 406, 205, 275, 438, 218, 416, 364, 484, 353, 79, 263, 418, 324, 126, 465, 321, 412, 375, 195, 353, 108, 474, 9, 465, 45, 109, 212, 200, 103, 161, 367, 25, 433, 487, 48, 32, 83, 464, 262, 241, 274, 261, 118, 212, 362, 422, 141, 5, 117, 202, 361, 273, 185, 160, 109, 348, 240, 270, 178, 390, 203, 267, 461, 476, 411, 433, 236, 407, 55, 84, 393, 447, 440, 31, 132, 479, 132, 85, 418, 100, 358, 477, 194, 452, 371, 215, 314, 440, 356, 404, 437, 497, 58, 207, 421, 90, 164, 145, 410, 350, 284, 280, 392, 322, 222, 467, 244, 84, 38, 219, 410, 94, 195, 268, 485, 498, 71, 226, 247, 195, 487, 411, 38, 324, 1, 120, 304, 181, 78, 472, 95, 256, 299, 206, 378, 291, 299, 499, 42, 271)), 6102)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.paintWalls(List(542932, 176748, 528763, 723496, 205229, 569602, 855413, 252409, 451644, 752515, 391378, 552141, 918526, 608397, 790351, 547393, 36987, 399333, 693449, 507850, 257562, 957301, 80124, 46962, 617075, 738660, 739606, 208005, 245619, 999747, 926465, 857235, 32314, 151653, 403719, 129163, 111217, 247632, 989445, 70773, 798094, 119830, 857546, 768177, 469061, 593438, 192602, 793793, 983811, 527957, 471132, 332839, 578695, 625665, 539311, 709077, 508455, 898232, 497152, 557317, 304355, 491761, 149263, 291055, 543057, 909762, 286684, 209263, 809584, 643006, 248488, 480365, 481572, 665681, 602314, 779717, 297994, 790629, 133977, 91611, 26589, 363499, 489816, 867966, 322271, 142219, 663326, 952428, 509719, 435273, 623918, 44859, 550995, 408929, 837041, 287107, 814889, 170652, 21272, 911567, 180075, 706453, 469966, 515095, 93090, 972562, 162587, 382528, 135270, 137527, 65395, 773540, 916033, 432874, 75035, 993526, 439715, 606919, 947861, 795089, 683259, 698370, 991693, 440152, 492648, 762356, 901542, 314605, 437478, 544278, 708501, 742927, 826138, 53033, 405592, 308437, 832635, 154543, 577190, 802244, 550509, 371448, 406462, 219024, 416924, 289491, 886016, 961607, 173599, 617886, 43146, 870084, 156990, 586596, 656088, 131117, 916728, 659394, 318884, 597270, 75532, 435071, 757293, 588155, 2395, 621737, 72227, 10064, 164948, 759882, 233833, 613101, 360107, 753743, 760038, 510667, 401783, 90913, 854566, 488303, 407893, 940594, 103064, 341305, 320297, 737299, 984074, 341451, 602349, 816863, 703311, 853208, 245951, 13876, 110802, 83218, 273585, 400508, 650311, 675898, 103351, 47356, 795687, 371693, 65057, 957791, 559519, 290648, 118321, 645381, 198342, 691144, 392626, 651445, 732465, 88741, 100881, 324264, 20258, 54198, 683430, 663870, 789564, 424050, 445109, 544906, 669549, 910184, 971750, 346977, 373410, 287388, 58631, 964018, 345149, 369731, 750120, 409430, 78313, 831366, 203177, 43768, 822715, 638808, 84078, 716323, 709795, 329365, 373709, 294495, 644868, 249288, 773645, 863862, 368110, 829215, 790585, 878798, 858714, 618500, 707792, 584552, 417696, 923809, 462187, 351921, 604817, 213153, 125789, 987390, 905733, 955801, 2932, 124623, 207751, 597737, 40510, 50084, 388339, 456445, 980679, 156742, 976366, 691822, 599552, 294660, 904345, 982801, 380365, 505404, 964699, 924150, 619304, 505995, 235354, 946421, 607981, 496575, 460603, 734771, 428742, 483678, 398382, 231091, 906368, 207310, 508187, 161200, 49077, 632603, 962138, 617116, 935491, 58057, 190347, 686536, 47224, 709475, 278422, 246483, 67382, 20610, 699295, 106076, 102406, 37326, 672398, 905822, 489179, 377490, 111997, 114897, 705579, 568004, 867084, 966172, 340731, 176051, 813005, 87385, 882562, 530183, 13651, 107968, 299288, 833913, 969691, 619770, 453490, 272332, 812831, 462269, 129512, 264247, 857887, 387827, 218513, 183900, 829792, 478893, 400394, 17576, 445030, 185498, 443246, 382949, 948359, 392625, 72716, 197136, 246564, 398258, 392090, 199975, 644412, 251305, 580446, 640601, 102437, 723261, 835904, 201225, 858990, 510162, 234708, 790980, 81, 761931, 60344, 76146, 699144, 430382, 111149, 551102, 321450, 621163, 841651, 421390, 264206, 334624, 166053, 584921, 856878, 966169, 841387, 608564, 51917, 662103, 635977, 955092, 533106, 827588, 494139, 513866, 551425, 700047, 298784, 534969, 689767, 577466, 764215, 550677, 205660, 816815, 544069, 338126, 592241, 42069, 182915, 807399, 566417, 719342, 8133, 324389, 897757, 889058, 408495, 931815, 28019, 900376, 605755, 333986, 327537, 368020, 828969, 916177, 751890, 35729, 746341, 54714, 310790, 771489, 629188, 675562, 967251, 649251, 17915, 719903, 318917, 786760, 265454, 740017, 393589, 537164, 268192, 105167, 206809, 804738, 134815, 67957, 135015, 663517, 781332, 527906, 316245, 481291, 113187, 209096, 569345, 381543, 25082, 729111, 586903, 488866, 563639, 190577, 854791, 204704, 795645),List(288, 457, 415, 33, 18, 397, 324, 193, 340, 109, 199, 291, 440, 160, 47, 140, 366, 106, 441, 25, 240, 402, 148, 245, 81, 342, 153, 174, 302, 198, 238, 208, 363, 108, 205, 66, 427, 312, 142, 8, 276, 159, 460, 248, 39, 231, 380, 300, 264, 460, 476, 107, 493, 34, 213, 46, 31, 110, 30, 49, 328, 10, 331, 355, 405, 452, 86, 362, 160, 191, 126, 452, 238, 200, 482, 472, 75, 385, 155, 99, 275, 115, 1, 120, 171, 363, 390, 333, 11, 485, 264, 449, 483, 37, 242, 377, 433, 74, 302, 263, 387, 381, 328, 56, 230, 309, 445, 52, 239, 107, 38, 449, 74, 186, 432, 352, 132, 416, 231, 69, 469, 85, 481, 393, 139, 118, 50, 124, 305, 366, 162, 295, 417, 458, 272, 472, 232, 466, 316, 359, 161, 342, 313, 87, 338, 446, 59, 247, 426, 131, 54, 312, 262, 98, 326, 284, 167, 20, 394, 23, 11, 176, 95, 390, 103, 195, 341, 470, 355, 333, 336, 68, 379, 57, 447, 127, 170, 240, 423, 346, 403, 375, 395, 74, 34, 64, 309, 48, 67, 62, 173, 369, 79, 312, 235, 270, 274, 20, 148, 282, 288, 347, 430, 180, 12, 33, 139, 450, 238, 410, 330, 481, 337, 310, 357, 439, 236, 395, 451, 313, 69, 384, 438, 126, 213, 68, 329, 349, 310, 223, 38, 146, 6, 188, 188, 100, 384, 248, 269, 481, 179, 401, 90, 433, 395, 233, 237, 481, 330, 171, 145, 338, 126, 119, 297, 14, 138, 381, 316, 38, 27, 63, 305, 203, 493, 430, 458, 39, 389, 355, 333, 316, 68, 254, 332, 76, 52, 19, 490, 378, 359, 289, 351, 199, 438, 241, 492, 244, 324, 62, 31, 486, 27, 226, 261, 377, 33, 475, 350, 238, 58, 407, 434, 174, 350, 86, 258, 371, 413, 49, 126, 307, 41, 136, 76, 257, 467, 189, 369, 459, 12, 45, 94, 29, 99, 443, 423, 87, 95, 280, 29, 398, 237, 449, 50, 37, 469, 285, 12, 160, 97, 65, 332, 14, 37, 283, 316, 75, 121, 366, 413, 274, 250, 483, 491, 461, 296, 331, 328, 239, 172, 217, 468, 395, 225, 254, 151, 48, 241, 335, 440, 255, 442, 2, 10, 370, 277, 296, 416, 226, 170, 287, 487, 417, 391, 100, 154, 250, 66, 320, 319, 308, 331, 409, 310, 432, 258, 356, 3, 98, 324, 428, 135, 460, 148, 222, 206, 296, 190, 319, 426, 70, 188, 34, 489, 61, 470, 315, 387, 26, 72, 116, 388, 274, 216, 123, 26, 18, 493, 380, 181, 137, 302, 36, 257, 12, 229, 475, 126, 112, 123, 417, 37, 375, 426, 395, 381, 248, 345, 22, 323, 50, 195, 429, 375, 320, 176, 136, 382, 26, 81, 25, 488, 140, 324, 477, 25, 473, 133, 202, 260, 432, 254, 241, 110, 425, 71, 77, 466, 121, 36, 136, 405, 477, 309, 421, 102, 212, 324)), 10145)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.paintWalls(List(319489, 378880, 781463, 939141, 148353, 925755, 201773, 349674, 785379, 936841, 562281, 985348, 118832, 883600, 702057, 11182, 961384, 388633, 980144, 400874, 392416, 401973, 769752, 244678, 4660, 668787, 983683, 153571, 772451, 618225, 624035, 836647, 219106, 721200, 71020, 361835, 121972, 837145, 67254, 219233, 496663, 798113, 641485, 238168, 716436, 959482, 655705, 489619, 797047, 402322, 904498, 39224, 680966, 894052, 598744, 437820, 255741, 714810, 818212, 279021, 735523, 947302, 682585, 159951, 689543, 672094, 479413, 193472, 271173, 398463, 671002, 111195, 772986, 530877, 747092, 622385, 258973, 647279, 1560, 230654, 410591, 616972, 458032, 280611, 91924, 586572, 182047, 131470, 106753, 791100, 153029, 492394, 267715, 916611, 750808, 529611, 634699, 573388, 269222, 957413, 327702, 935686, 140353, 846069, 648580, 52685, 988999, 47619, 32439, 848933, 408922, 766183, 342126, 761199, 961015, 234643, 477560, 916219, 40810, 981333, 969545, 755569, 993713, 523817, 413491, 879601, 725635, 235533, 717575, 633788, 297386, 905060, 204166, 983165, 453317, 974112, 435161, 945793, 989415, 252894, 60885, 614578, 570243, 647477, 677795, 129480, 913347, 714492, 45892, 37107, 819722, 705733, 808228, 424001, 572334, 497223, 234669, 624080, 30768, 370986, 273904, 37572, 79753, 455734, 343873, 523567, 202244, 575353, 668731, 808061, 380901, 975013, 631502, 161592, 588952, 375463, 712379, 161222, 850024, 31159, 342198, 546062, 944561, 705291, 230847, 224333, 860677, 650773, 150624, 353229, 952513, 213927, 670201, 504903, 767049, 81018, 949093, 300644, 611674, 667114, 925532, 218560, 924426, 302672, 265346, 205395, 851981, 431768, 694303, 145514, 680039, 406155, 602087, 588, 256946, 434768, 619627, 20374, 974051, 152600, 540306, 695162, 209830, 259998, 563664, 772076, 106123, 521262, 314605, 788109, 442322, 791237, 590906, 413966, 169370, 927235, 56858, 601709, 47197, 216043, 132462, 786160, 650789, 688244, 269989, 329346, 386792, 518901, 503229, 150675, 248511, 405817, 883588, 74437, 693075, 282787, 333898, 771554, 170881, 832752, 81058, 743886, 710555, 823449, 330207, 293216, 989441, 483125, 205570, 992521, 167407, 666967, 334537, 163370, 788124, 438473, 49112, 181100, 441247, 977434, 882554, 268577, 865785, 981759, 192970, 552428, 634432, 895627, 827728, 40659, 969279, 716147, 87867, 546368, 415019, 665338, 140224, 721710, 107262, 356262, 218887, 818235, 832681, 499471, 592517, 236674, 550451, 712113, 958827, 433542, 979717, 664454, 974469, 636997, 11721, 389233, 451774, 989193, 155045, 315986, 421903, 266718, 44313, 835203, 212142, 154299, 276282, 821113, 306126, 368525, 165093, 773275, 345512, 352021, 767600, 750264, 681708, 486179, 154576, 613476, 722995, 615564, 592515, 634034, 325775, 302406, 854865, 52845, 17947, 655230, 986338, 882018, 180302, 611843, 945801, 21566, 995355, 327907, 905083, 432087, 945958, 649543, 671374, 326935, 744547, 806327, 789525, 856598, 487401, 128900, 713593, 585680, 283688, 159756, 836039, 868130, 539953, 219179, 520484, 738834, 203393, 564241, 177269, 955313, 468120, 662749, 110899, 916269, 853908, 745369, 439906, 504328, 896961, 743052, 655126, 900048, 340548, 326119, 408603, 458074, 227952, 109242, 354788, 721900, 99097, 673446, 306125, 963758, 56467, 142667, 481968, 843458, 470408, 769577, 600879, 244900, 302468, 798657, 366429, 703504, 25231, 987316, 689891, 458596, 217387, 502556, 788319, 511280, 360320, 965051, 747393),List(102, 465, 81, 106, 191, 195, 13, 71, 213, 313, 224, 196, 450, 426, 214, 468, 88, 426, 420, 231, 122, 213, 427, 440, 327, 217, 60, 271, 469, 127, 489, 113, 87, 117, 200, 465, 79, 491, 236, 341, 252, 225, 55, 196, 25, 467, 324, 498, 330, 55, 404, 177, 388, 403, 174, 111, 453, 393, 287, 333, 271, 246, 445, 426, 126, 116, 487, 97, 20, 143, 213, 45, 253, 94, 75, 150, 32, 346, 249, 245, 63, 2, 312, 365, 277, 495, 168, 55, 105, 406, 72, 198, 283, 316, 479, 15, 380, 433, 124, 53, 298, 158, 267, 60, 439, 72, 144, 203, 318, 55, 277, 131, 266, 3, 148, 263, 229, 173, 277, 497, 154, 295, 225, 7, 278, 237, 316, 261, 355, 200, 317, 483, 259, 238, 150, 348, 131, 376, 391, 257, 417, 88, 341, 435, 272, 324, 135, 48, 357, 325, 23, 101, 325, 163, 58, 294, 33, 208, 236, 332, 349, 428, 108, 180, 211, 81, 464, 233, 320, 308, 399, 299, 330, 55, 56, 415, 268, 406, 380, 289, 93, 322, 345, 125, 28, 500, 37, 134, 23, 243, 437, 294, 483, 123, 412, 168, 207, 52, 148, 423, 365, 284, 237, 222, 52, 61, 458, 29, 352, 306, 243, 462, 499, 34, 236, 216, 37, 454, 175, 2, 351, 217, 462, 275, 321, 470, 217, 249, 360, 107, 141, 430, 156, 181, 37, 284, 254, 131, 312, 79, 32, 279, 445, 11, 290, 336, 133, 96, 62, 388, 155, 65, 37, 81, 200, 493, 404, 308, 450, 212, 440, 152, 99, 290, 217, 494, 2, 432, 198, 164, 467, 296, 423, 396, 27, 486, 125, 392, 151, 114, 357, 161, 378, 472, 442, 302, 114, 200, 441, 93, 496, 478, 321, 371, 41, 179, 265, 246, 237, 359, 99, 12, 263, 208, 194, 239, 318, 360, 457, 387, 14, 148, 307, 200, 377, 77, 417, 325, 112, 386, 13, 13, 273, 466, 185, 141, 308, 260, 145, 153, 131, 194, 378, 41, 142, 70, 117, 34, 359, 382, 324, 223, 383, 458, 357, 177, 463, 245, 57, 216, 411, 144, 419, 321, 71, 129, 221, 359, 156, 155, 187, 74, 209, 217, 92, 375, 277, 335, 316, 45, 483, 371, 221, 12, 79, 69, 130, 487, 450, 163, 12, 309, 452, 372, 425, 331, 301, 70, 221, 237, 457, 377, 411, 179, 128, 247, 464, 411, 379, 179, 180, 234, 481, 287, 353, 31, 400, 385, 251, 9, 239, 185, 497, 373, 389, 281, 153, 352, 387, 221, 425, 268, 25, 149, 327, 216, 260, 246, 190, 378, 275)), 6220)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.paintWalls(List(4060, 559836, 412974, 237614, 467812, 394271, 868873, 489389, 38554, 517520, 352957, 141959, 426589, 711472, 395011, 592043, 844357, 587576, 436846, 828848, 833391, 307317, 159736, 369923, 546947, 125995, 598835, 358970, 617159, 130239, 825910, 406938, 940700, 626835, 422296, 390237, 708096, 620417, 92310, 683088, 107354, 657184, 756522, 854914, 992600, 352404, 330552, 797730, 719877, 169596, 609008, 589260, 382901, 306837, 151478, 69515, 186412, 420261, 274073, 157411, 248076, 619926, 934059, 198563, 182280, 561117, 868892, 638264, 990384, 39125, 470562, 210021, 996444, 519693, 711428, 907137, 562032, 997581, 537023, 462553, 626500, 979117, 782452, 910921, 243227, 762723, 564298, 204067, 525204, 447635, 410584, 22759, 907452, 202123, 663220, 841913, 491248, 864823, 500016, 719592, 458071, 965126, 927997, 416997, 526329, 368590, 559581, 386807, 950204, 851416, 875532, 439040, 879172, 374286, 441466, 440020, 365818, 96082, 176210, 132196, 28850, 54217, 180862, 964984, 622124, 566793, 223172, 264111, 51588, 246205, 332389, 983490, 798596, 34435, 325826, 126076, 79091, 45653, 434404, 530972, 910980, 454164, 719266, 220902, 187892, 949080, 730125, 132745, 301486, 660706, 204228, 367590, 781649, 588188, 407547, 189250, 91611, 316033, 728828, 950364, 57093, 652168, 215037, 974796, 577420, 173397, 881282, 772933, 975894, 667337, 387535, 937280, 994880, 195705, 967864, 589873, 578961, 876328, 926533, 9467, 303764, 852914, 159124, 953328, 91342, 233817, 278630, 877416, 71342, 562499, 607080, 173666, 364015, 115110, 732517, 49480, 613729, 315687, 183529, 193175, 563195, 673154, 551386, 375305, 832712, 923841, 399873, 944347, 823270, 125446, 780812, 306445, 415015, 662298, 735035, 66592, 275236, 16187, 181948, 919636, 399188, 847199, 963872, 777634, 81049, 957549, 953132, 400596, 969396, 408787, 675530, 497745, 926288, 751863, 840413, 174776, 900500, 284811, 623726, 365676, 338807, 638616, 774270, 222421, 227487, 288140, 846435, 50992, 878832, 944007, 951591, 246924, 969050, 304090, 215441, 494940, 245183, 828482, 10924, 354411, 30930, 688853, 31839, 209769, 373951, 531348, 363880, 383208, 765894, 479419, 430864, 167924, 846174, 428562, 661391, 623773, 476830, 386354, 465624, 962954, 178154, 470986, 923876, 770211, 703110, 895952, 83247, 208689, 385285, 337169, 726488, 209259, 445374, 480739, 62868, 289304, 245238, 174825, 743832),List(45, 355, 390, 338, 5, 366, 395, 459, 90, 413, 49, 406, 320, 167, 369, 360, 408, 401, 282, 153, 184, 383, 145, 474, 347, 239, 7, 251, 231, 163, 300, 348, 282, 312, 258, 259, 105, 496, 118, 71, 109, 212, 331, 480, 445, 383, 280, 108, 491, 367, 334, 357, 247, 318, 114, 171, 371, 456, 158, 267, 218, 172, 113, 123, 378, 363, 397, 482, 442, 238, 339, 426, 454, 386, 413, 491, 247, 428, 465, 78, 16, 163, 96, 413, 56, 136, 178, 288, 181, 9, 400, 278, 266, 474, 122, 120, 337, 218, 163, 10, 403, 175, 144, 354, 275, 179, 63, 491, 408, 334, 185, 116, 321, 328, 498, 480, 477, 15, 437, 17, 362, 218, 220, 392, 370, 334, 439, 179, 77, 102, 231, 496, 62, 119, 358, 206, 182, 152, 489, 346, 209, 332, 152, 478, 431, 109, 105, 138, 369, 34, 59, 323, 389, 499, 205, 1, 477, 282, 426, 320, 176, 29, 496, 42, 395, 144, 289, 144, 191, 174, 59, 211, 311, 433, 62, 305, 214, 321, 462, 129, 95, 318, 496, 45, 275, 60, 205, 134, 457, 23, 243, 80, 324, 372, 278, 131, 209, 386, 49, 335, 269, 434, 55, 37, 29, 223, 185, 138, 162, 344, 113, 352, 225, 444, 91, 178, 428, 106, 235, 410, 43, 40, 207, 16, 96, 25, 220, 157, 429, 343, 310, 476, 17, 342, 30, 404, 251, 452, 382, 304, 6, 39, 407, 137, 328, 191, 341, 358, 99, 264, 467, 270, 332, 118, 323, 489, 403, 91, 18, 279, 249, 69, 331, 70, 326, 188, 174, 342, 397, 179, 246, 206, 34, 36, 439, 487, 79, 130, 211, 465, 12, 268, 122, 441, 149, 83, 95, 168, 90, 437, 121, 382, 419, 98, 117, 188, 367, 136, 222)), 26819)
42
+ }
43
+
44
+ }
palindrome_rearrangement_queries/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(true,true)), canMakePalindromeQueries("abcabc", new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,1,3,5)),new ArrayList<>(Arrays.asList(0,2,5,5))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(false)), canMakePalindromeQueries("abbcdecbba", new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(0,2,7,9))))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(new ArrayList<>(Arrays.asList(true)), canMakePalindromeQueries("acbcab", new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,2,4,5))))));
23
+ }
24
+
25
+ }
partition_array_according_to_given_pivot/.DS_Store ADDED
Binary file (6.15 kB). View file
 
partition_array_according_to_given_pivot/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 (pivotArray [9,12,5,10,14,3,10] 10)," [9,5,3,10,10,12,14] (pivotArray [9,12,5,10,14,3,10] 10))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (pivotArray [-3,4,3,2] 2)," [-3,2,4,3] (pivotArray [-3,4,3,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
partition_array_according_to_given_pivot/java_tests/Main.java ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import static org.junit.jupiter.api.Assertions.*;
3
+ import org.junit.jupiter.api.Test;
4
+ import java.util.List;
5
+ import java.util.Arrays;
6
+ import java.util.ArrayList;
7
+ public class Main {
8
+ //Program start
9
+
10
+ //Program end
11
+
12
+ @Test
13
+ public void test1() {
14
+ assertEquals(new ArrayList<>(Arrays.asList(9,5,3,10,10,12,14)), pivotArray(new ArrayList<>(Arrays.asList(9,12,5,10,14,3,10)), 10));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(new ArrayList<>(Arrays.asList(-3,2,4,3)), pivotArray(new ArrayList<>(Arrays.asList(-3,4,3,2)), 2));
19
+ }
20
+
21
+ }
partition_array_according_to_given_pivot/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5cd21cfb417d0e4b89640cf98bcbe6ade418e01039b2350c351b8dbe1d0cb927
3
+ size 33417567
partition_array_according_to_given_pivot/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal [9;5;3;10;10;12;14] (pivotArray [9;12;5;10;14;3;10] 10)
12
+
13
+ let test2 _ = assert_equal [-3;2;4;3] (pivotArray [-3;4;3;2] 2)
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for pivotArray" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
partition_array_according_to_given_pivot/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.pivotArray(List(9,12,5,10,14,3,10),10), List(9,5,3,10,10,12,14))
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.pivotArray(List(-3,4,3,2),2), List(-3,2,4,3))
10
+ }
11
+
12
+ }
partition_array_such_that_maximum_difference_is_k/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
partition_array_such_that_maximum_difference_is_k/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(2, partitionArray(new ArrayList<>(Arrays.asList(3,6,1,2,5)), 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(2, partitionArray(new ArrayList<>(Arrays.asList(1,2,3)), 1));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(3, partitionArray(new ArrayList<>(Arrays.asList(2,2,4,5)), 0));
23
+ }
24
+
25
+ }
partition_array_such_that_maximum_difference_is_k/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac499c0dbf11c41379111f016d257c4a7658c80b08e2dcf44106aa13aec38cd6
3
+ size 11326067
partition_array_such_that_maximum_difference_is_k/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
partition_array_such_that_maximum_difference_is_k/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
partition_string_into_minimum_beautiful_substrings/.DS_Store ADDED
Binary file (6.15 kB). View file
 
partition_string_into_minimum_beautiful_substrings/haskell_tests/Main.hs ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+
7
+ --Program end
8
+
9
+ -- Test cases
10
+
11
+ test1 :: Test
12
+ test1 = TestCase (assertEqual "for (minimumBeautifulSubstrings \"1011 \")," 2 (minimumBeautifulSubstrings "1011"))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (minimumBeautifulSubstrings \"111 \")," 3 (minimumBeautifulSubstrings "111"))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (minimumBeautifulSubstrings \"0 \")," (-1) (minimumBeautifulSubstrings "0"))
19
+
20
+
21
+ -- Grouping test cases
22
+ tests :: Test
23
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2]
24
+
25
+ -- Running the tests
26
+ main :: IO Counts
27
+ main = runTestTT tests
partition_string_into_minimum_beautiful_substrings/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(2, minimumBeautifulSubstrings("1011"));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(3, minimumBeautifulSubstrings("111"));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(-1, minimumBeautifulSubstrings("0"));
23
+ }
24
+
25
+ }
partition_string_into_minimum_beautiful_substrings/meta.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2883,
3
+ "name": "partition_string_into_minimum_beautiful_substrings",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/partition-string-into-minimum-beautiful-substrings/",
6
+ "date": "1687564800000",
7
+ "task_description": "Given a binary string `s`, partition the string into one or more **substrings** such that each substring is **beautiful**. A string is **beautiful** if: It doesn't contain leading zeros. It's the **binary** representation of a number that is a power of `5`. Return _the **minimum** number of substrings in such partition. _If it is impossible to partition the string `s` into beautiful substrings, return `-1`. A **substring** is a contiguous sequence of characters in a string. **Example 1:** ``` **Input:** s = \"1011\" **Output:** 2 **Explanation:** We can paritition the given string into [\"101\", \"1\"]. - The string \"101\" does not contain leading zeros and is the binary representation of integer 51 = 5. - The string \"1\" does not contain leading zeros and is the binary representation of integer 50 = 1. It can be shown that 2 is the minimum number of beautiful substrings that s can be partitioned into. ``` **Example 2:** ``` **Input:** s = \"111\" **Output:** 3 **Explanation:** We can paritition the given string into [\"1\", \"1\", \"1\"]. - The string \"1\" does not contain leading zeros and is the binary representation of integer 50 = 1. It can be shown that 3 is the minimum number of beautiful substrings that s can be partitioned into. ``` **Example 3:** ``` **Input:** s = \"0\" **Output:** -1 **Explanation:** We can not partition the given string into beautiful substrings. ``` **Constraints:** `1 <= s.length <= 15` `s[i]` is either `'0'` or `'1'`.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "s = \"1011\"",
12
+ "output": "2 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "s = \"111\"",
17
+ "output": "3 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "s = \"0\"",
22
+ "output": "-1 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": "1001110001",
28
+ "output": 1
29
+ },
30
+ {
31
+ "input": "101",
32
+ "output": 1
33
+ },
34
+ {
35
+ "input": "011000111100100",
36
+ "output": -1
37
+ },
38
+ {
39
+ "input": "1",
40
+ "output": 1
41
+ },
42
+ {
43
+ "input": "100101",
44
+ "output": -1
45
+ },
46
+ {
47
+ "input": "101",
48
+ "output": 1
49
+ },
50
+ {
51
+ "input": "11111001",
52
+ "output": 4
53
+ },
54
+ {
55
+ "input": "11111001",
56
+ "output": 4
57
+ },
58
+ {
59
+ "input": "1001110001",
60
+ "output": 1
61
+ },
62
+ {
63
+ "input": "101",
64
+ "output": 1
65
+ }
66
+ ],
67
+ "haskell_template": "minimumBeautifulSubstrings :: String -> Int\nminimumBeautifulSubstrings s ",
68
+ "ocaml_template": "let minimumBeautifulSubstrings (s: string) : int = ",
69
+ "scala_template": "def minimumBeautifulSubstrings(s: String): Int = { \n \n}",
70
+ "java_template": "public static int minimumBeautifulSubstrings(String s) {\n\n}",
71
+ "python_template": "class Solution(object):\n def minimumBeautifulSubstrings(self, s):\n \"\"\"\n :type s: str\n :rtype: int\n \"\"\"\n "
72
+ }
partition_string_into_minimum_beautiful_substrings/ocaml_tests/main.ml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 2 (minimumBeautifulSubstrings "1011")
12
+
13
+ let test2 _ = assert_equal 3 (minimumBeautifulSubstrings "111")
14
+
15
+ let test3 _ = assert_equal (-1) (minimumBeautifulSubstrings "0")
16
+
17
+
18
+ (* Grouping test cases *)
19
+ let suite = "Test Suite for minimumBeautifulSubstrings" >::: [
20
+
21
+ "test1" >:: test1;
22
+ "test2" >:: test2;
23
+ "test3" >:: test3;
24
+ ]
25
+
26
+
27
+ (* Running the tests *)
28
+ let () = run_test_tt_main suite
29
+ end
partition_string_into_minimum_beautiful_substrings/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.minimumBeautifulSubstrings("1011"), 2)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.minimumBeautifulSubstrings("111"), 3)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.minimumBeautifulSubstrings("0"), -1)
14
+ }
15
+
16
+ }
partition_string_into_substrings_with_values_at_most_k/.DS_Store ADDED
Binary file (6.15 kB). View file
 
partition_string_into_substrings_with_values_at_most_k/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 (minimumPartition \"165462 \" 60)," 4 (minimumPartition "165462" 60))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (minimumPartition \"238182 \" 5)," (-1) (minimumPartition "238182" 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
partition_string_into_substrings_with_values_at_most_k/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, minimumPartition("165462", 60));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(-1, minimumPartition("238182", 5));
19
+ }
20
+
21
+ }
partition_string_into_substrings_with_values_at_most_k/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
partition_string_into_substrings_with_values_at_most_k/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 4 (minimumPartition "165462" 60)
12
+
13
+ let test2 _ = assert_equal (-1) (minimumPartition "238182" 5)
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for minimumPartition" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
partition_string_into_substrings_with_values_at_most_k/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.minimumPartition("165462",60), 4)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.minimumPartition("238182",5), -1)
10
+ }
11
+
12
+ }
pass_the_pillow/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 (passThePillow 4 5)," 2 (passThePillow 4 5))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (passThePillow 3 2)," 3 (passThePillow 3 2))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (passThePillow 724 598)," 599 (passThePillow 724 598))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (passThePillow 977 319)," 320 (passThePillow 977 319))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (passThePillow 638 481)," 482 (passThePillow 638 481))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (passThePillow 436 189)," 190 (passThePillow 436 189))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (passThePillow 31 202)," 23 (passThePillow 31 202))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (passThePillow 603 872)," 333 (passThePillow 603 872))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (passThePillow 952 39)," 40 (passThePillow 952 39))
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
pass_the_pillow/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, passThePillow(4, 5));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(3, passThePillow(3, 2));
19
+ }
20
+
21
+ }
pass_the_pillow/meta.json ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 2645,
3
+ "name": "pass_the_pillow",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/pass-the-pillow/",
6
+ "date": "2023-02-26 00:00:00",
7
+ "task_description": "There are `n` people standing in a line labeled from `1` to `n`. The first person in the line is holding a pillow initially. Every second, the person holding the pillow passes it to the next person standing in the line. Once the pillow reaches the end of the line, the direction changes, and people continue passing the pillow in the opposite direction. For example, once the pillow reaches the `nth` person they pass it to the `n - 1th` person, then to the `n - 2th` person and so on. Given the two positive integers `n` and `time`, return _the index of the person holding the pillow after _`time`_ seconds_. **Example 1:** ``` **Input:** n = 4, time = 5 **Output:** 2 **Explanation:** People pass the pillow in the following way: 1 -> 2 -> 3 -> 4 -> 3 -> 2. After five seconds, the 2nd person is holding the pillow. ``` **Example 2:** ``` **Input:** n = 3, time = 2 **Output:** 3 **Explanation:** People pass the pillow in the following way: 1 -> 2 -> 3. After two seconds, the 3rd person is holding the pillow. ``` **Constraints:** `2 <= n <= 1000` `1 <= time <= 1000` **Note:** This question is the same as 3178: Find the Child Who Has the Ball After K Seconds.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "n = 4, time = 5",
12
+ "output": "2 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "n = 3, time = 2",
17
+ "output": "3 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ 724,
24
+ 598
25
+ ],
26
+ "output": 599
27
+ },
28
+ {
29
+ "input": [
30
+ 977,
31
+ 319
32
+ ],
33
+ "output": 320
34
+ },
35
+ {
36
+ "input": [
37
+ 638,
38
+ 481
39
+ ],
40
+ "output": 482
41
+ },
42
+ {
43
+ "input": [
44
+ 436,
45
+ 189
46
+ ],
47
+ "output": 190
48
+ },
49
+ {
50
+ "input": [
51
+ 31,
52
+ 202
53
+ ],
54
+ "output": 23
55
+ },
56
+ {
57
+ "input": [
58
+ 603,
59
+ 872
60
+ ],
61
+ "output": 333
62
+ },
63
+ {
64
+ "input": [
65
+ 952,
66
+ 39
67
+ ],
68
+ "output": 40
69
+ },
70
+ {
71
+ "input": [
72
+ 440,
73
+ 944
74
+ ],
75
+ "output": 67
76
+ },
77
+ {
78
+ "input": [
79
+ 668,
80
+ 587
81
+ ],
82
+ "output": 588
83
+ },
84
+ {
85
+ "input": [
86
+ 455,
87
+ 332
88
+ ],
89
+ "output": 333
90
+ }
91
+ ],
92
+ "haskell_template": "passThePillow :: Int -> Int -> Int\npassThePillow n time ",
93
+ "ocaml_template": "let passThePillow (n: int) (time: int) : int = ",
94
+ "scala_template": "def passThePillow(n: Int,time: Int): Int = { \n \n}",
95
+ "java_template": "class Solution {\n public int passThePillow(int n, int time) {\n \n }\n}",
96
+ "python_template": "class Solution(object):\n def passThePillow(self, n, time):\n \"\"\"\n :type n: int\n :type time: int\n :rtype: int\n \"\"\"\n "
97
+ }