DatasetRepo commited on
Commit
796c546
·
verified ·
1 Parent(s): 6bad75b

2dc0f28d5f527335410d74b76fd7b2b0b98971f50a2870d6872a805213a9af25

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 +1 -0
  2. find_the_integer_added_to_array_i/meta.json +1170 -0
  3. find_the_integer_added_to_array_i/ocaml_tests/main.ml +50 -0
  4. find_the_integer_added_to_array_i/scala_tests/MySuite.scala +44 -0
  5. find_the_integer_added_to_array_ii/haskell_tests/Main.hs +26 -0
  6. find_the_integer_added_to_array_ii/java_tests/Main.java +20 -0
  7. find_the_integer_added_to_array_ii/meta.json +26 -0
  8. find_the_integer_added_to_array_ii/ocaml_tests/main.ml +27 -0
  9. find_the_integer_added_to_array_ii/scala_tests/MySuite.scala +12 -0
  10. find_the_k_or_of_an_array/haskell_tests/Main.hs +45 -0
  11. find_the_k_or_of_an_array/java_tests/Main.java +25 -0
  12. find_the_k_or_of_an_array/meta.json +375 -0
  13. find_the_k_or_of_an_array/ocaml_tests/main.ml +50 -0
  14. find_the_k_or_of_an_array/scala_tests/MySuite.scala +44 -0
  15. find_the_k_sum_of_an_array/.DS_Store +0 -0
  16. find_the_k_sum_of_an_array/haskell_tests/Main.hs +24 -0
  17. find_the_k_sum_of_an_array/java_tests/Main.java +21 -0
  18. find_the_k_sum_of_an_array/meta.json +3 -0
  19. find_the_k_sum_of_an_array/ocaml_tests/main.ml +26 -0
  20. find_the_k_sum_of_an_array/scala_tests/MySuite.scala +12 -0
  21. find_the_k_th_character_in_string_game_ii/haskell_tests/Main.hs +45 -0
  22. find_the_k_th_character_in_string_game_ii/java_tests/Main.java +21 -0
  23. find_the_k_th_character_in_string_game_ii/meta.json +690 -0
  24. find_the_k_th_character_in_string_game_ii/ocaml_tests/main.ml +50 -0
  25. find_the_k_th_character_in_string_game_ii/scala_tests/MySuite.scala +44 -0
  26. find_the_key_of_the_numbers/haskell_tests/Main.hs +45 -0
  27. find_the_key_of_the_numbers/java_tests/Main.java +21 -0
  28. find_the_key_of_the_numbers/meta.json +112 -0
  29. find_the_key_of_the_numbers/ocaml_tests/main.ml +50 -0
  30. find_the_key_of_the_numbers/scala_tests/MySuite.scala +44 -0
  31. find_the_largest_almost_missing_integer/haskell_tests/Main.hs +45 -0
  32. find_the_largest_almost_missing_integer/java_tests/Main.java +25 -0
  33. find_the_largest_almost_missing_integer/meta.json +358 -0
  34. find_the_largest_almost_missing_integer/ocaml_tests/main.ml +50 -0
  35. find_the_largest_almost_missing_integer/scala_tests/MySuite.scala +44 -0
  36. find_the_largest_area_of_square_inside_two_rectangles/haskell_tests/Main.hs +0 -0
  37. find_the_largest_area_of_square_inside_two_rectangles/java_tests/Main.java +29 -0
  38. find_the_largest_area_of_square_inside_two_rectangles/meta.json +0 -0
  39. find_the_largest_area_of_square_inside_two_rectangles/ocaml_tests/main.ml +0 -0
  40. find_the_largest_area_of_square_inside_two_rectangles/scala_tests/MySuite.scala +0 -0
  41. find_the_largest_palindrome_divisible_by_k/java_tests/Main.java +25 -0
  42. find_the_length_of_the_longest_common_prefix/haskell_tests/Main.hs +42 -0
  43. find_the_length_of_the_longest_common_prefix/java_tests/Main.java +21 -0
  44. find_the_length_of_the_longest_common_prefix/meta.json +338 -0
  45. find_the_length_of_the_longest_common_prefix/ocaml_tests/main.ml +44 -0
  46. find_the_length_of_the_longest_common_prefix/scala_tests/MySuite.scala +36 -0
  47. find_the_lexicographically_largest_string_from_the_box_i/haskell_tests/Main.hs +45 -0
  48. find_the_lexicographically_largest_string_from_the_box_i/java_tests/Main.java +21 -0
  49. find_the_lexicographically_largest_string_from_the_box_i/meta.json +97 -0
  50. find_the_lexicographically_largest_string_from_the_box_i/ocaml_tests/main.ml +50 -0
.gitattributes CHANGED
@@ -122,3 +122,4 @@ find_number_of_coins_to_place_in_tree_nodes/meta.json filter=lfs diff=lfs merge=
122
  find_occurrences_of_an_element_in_an_array/meta.json filter=lfs diff=lfs merge=lfs -text
123
  find_subtree_sizes_after_changes/meta.json filter=lfs diff=lfs merge=lfs -text
124
  find_the_first_player_to_win_k_games_in_a_row/meta.json filter=lfs diff=lfs merge=lfs -text
 
 
122
  find_occurrences_of_an_element_in_an_array/meta.json filter=lfs diff=lfs merge=lfs -text
123
  find_subtree_sizes_after_changes/meta.json filter=lfs diff=lfs merge=lfs -text
124
  find_the_first_player_to_win_k_games_in_a_row/meta.json filter=lfs diff=lfs merge=lfs -text
125
+ find_the_k_sum_of_an_array/meta.json filter=lfs diff=lfs merge=lfs -text
find_the_integer_added_to_array_i/meta.json ADDED
@@ -0,0 +1,1170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3397,
3
+ "name": "find_the_integer_added_to_array_i",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/find-the-integer-added-to-array-i/",
6
+ "date": "2024-04-21 00:00:00",
7
+ "task_description": "You are given two arrays of equal length, `nums1` and `nums2`. Each element in `nums1` has been increased (or decreased in the case of negative) by an integer, represented by the variable `x`. As a result, `nums1` becomes **equal** to `nums2`. Two arrays are considered **equal** when they contain the same integers with the same frequencies. Return the integer `x`. **Example 1:** **Input:** nums1 = [2,6,4], nums2 = [9,7,5] **Output:** 3 **Explanation:** The integer added to each element of `nums1` is 3. **Example 2:** **Input:** nums1 = [10], nums2 = [5] **Output:** -5 **Explanation:** The integer added to each element of `nums1` is -5. **Example 3:** **Input:** nums1 = [1,1,1,1], nums2 = [1,1,1,1] **Output:** 0 **Explanation:** The integer added to each element of `nums1` is 0. **Constraints:** `1 <= nums1.length == nums2.length <= 100` `0 <= nums1[i], nums2[i] <= 1000` The test cases are generated in a way that there is an integer `x` such that `nums1` can become equal to `nums2` by adding `x` to each element of `nums1`.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "nums1 = [2,6,4], nums2 = [9,7,5]",
12
+ "output": "3 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "nums1 = [10], nums2 = [5]",
17
+ "output": "-5 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "nums1 = [1,1,1,1], nums2 = [1,1,1,1]",
22
+ "output": "0 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ [
29
+ 900,
30
+ 406,
31
+ 917,
32
+ 736,
33
+ 331,
34
+ 89,
35
+ 81,
36
+ 268,
37
+ 776,
38
+ 577,
39
+ 299,
40
+ 33,
41
+ 555,
42
+ 191,
43
+ 54,
44
+ 329,
45
+ 85,
46
+ 429,
47
+ 623,
48
+ 887,
49
+ 533,
50
+ 290,
51
+ 806,
52
+ 636,
53
+ 946,
54
+ 105
55
+ ],
56
+ [
57
+ 697,
58
+ 203,
59
+ 714,
60
+ 533,
61
+ 128,
62
+ -114,
63
+ -122,
64
+ 65,
65
+ 573,
66
+ 374,
67
+ 96,
68
+ -170,
69
+ 352,
70
+ -12,
71
+ -149,
72
+ 126,
73
+ -118,
74
+ 226,
75
+ 420,
76
+ 684,
77
+ 330,
78
+ 87,
79
+ 603,
80
+ 433,
81
+ 743,
82
+ -98
83
+ ]
84
+ ],
85
+ "output": -203
86
+ },
87
+ {
88
+ "input": [
89
+ [
90
+ 102,
91
+ 64,
92
+ 584,
93
+ 874,
94
+ 258,
95
+ 453,
96
+ 115,
97
+ 505,
98
+ 147,
99
+ 784,
100
+ 692,
101
+ 257,
102
+ 884,
103
+ 872,
104
+ 194,
105
+ 380,
106
+ 23,
107
+ 268,
108
+ 125,
109
+ 419,
110
+ 704,
111
+ 749,
112
+ 149,
113
+ 458,
114
+ 730,
115
+ 731,
116
+ 113,
117
+ 649,
118
+ 697,
119
+ 895,
120
+ 172,
121
+ 384,
122
+ 568,
123
+ 414,
124
+ 69,
125
+ 407,
126
+ 696,
127
+ 501,
128
+ 285,
129
+ 478,
130
+ 524,
131
+ 198,
132
+ 11,
133
+ 942,
134
+ 464,
135
+ 816,
136
+ 461,
137
+ 869,
138
+ 211
139
+ ],
140
+ [
141
+ 673,
142
+ 635,
143
+ 1155,
144
+ 1445,
145
+ 829,
146
+ 1024,
147
+ 686,
148
+ 1076,
149
+ 718,
150
+ 1355,
151
+ 1263,
152
+ 828,
153
+ 1455,
154
+ 1443,
155
+ 765,
156
+ 951,
157
+ 594,
158
+ 839,
159
+ 696,
160
+ 990,
161
+ 1275,
162
+ 1320,
163
+ 720,
164
+ 1029,
165
+ 1301,
166
+ 1302,
167
+ 684,
168
+ 1220,
169
+ 1268,
170
+ 1466,
171
+ 743,
172
+ 955,
173
+ 1139,
174
+ 985,
175
+ 640,
176
+ 978,
177
+ 1267,
178
+ 1072,
179
+ 856,
180
+ 1049,
181
+ 1095,
182
+ 769,
183
+ 582,
184
+ 1513,
185
+ 1035,
186
+ 1387,
187
+ 1032,
188
+ 1440,
189
+ 782
190
+ ]
191
+ ],
192
+ "output": 571
193
+ },
194
+ {
195
+ "input": [
196
+ [
197
+ 728,
198
+ 220,
199
+ 82
200
+ ],
201
+ [
202
+ 1309,
203
+ 801,
204
+ 663
205
+ ]
206
+ ],
207
+ "output": 581
208
+ },
209
+ {
210
+ "input": [
211
+ [
212
+ 382,
213
+ 525,
214
+ 20,
215
+ 929,
216
+ 409,
217
+ 352,
218
+ 407,
219
+ 278,
220
+ 120,
221
+ 425,
222
+ 299,
223
+ 168,
224
+ 262,
225
+ 257,
226
+ 274,
227
+ 447,
228
+ 147,
229
+ 941,
230
+ 307,
231
+ 991,
232
+ 380,
233
+ 775,
234
+ 384,
235
+ 536,
236
+ 143,
237
+ 384,
238
+ 600,
239
+ 131,
240
+ 870,
241
+ 20,
242
+ 937,
243
+ 71,
244
+ 809,
245
+ 664,
246
+ 524,
247
+ 707,
248
+ 930,
249
+ 724,
250
+ 730,
251
+ 477,
252
+ 326,
253
+ 390,
254
+ 310
255
+ ],
256
+ [
257
+ 1308,
258
+ 1451,
259
+ 946,
260
+ 1855,
261
+ 1335,
262
+ 1278,
263
+ 1333,
264
+ 1204,
265
+ 1046,
266
+ 1351,
267
+ 1225,
268
+ 1094,
269
+ 1188,
270
+ 1183,
271
+ 1200,
272
+ 1373,
273
+ 1073,
274
+ 1867,
275
+ 1233,
276
+ 1917,
277
+ 1306,
278
+ 1701,
279
+ 1310,
280
+ 1462,
281
+ 1069,
282
+ 1310,
283
+ 1526,
284
+ 1057,
285
+ 1796,
286
+ 946,
287
+ 1863,
288
+ 997,
289
+ 1735,
290
+ 1590,
291
+ 1450,
292
+ 1633,
293
+ 1856,
294
+ 1650,
295
+ 1656,
296
+ 1403,
297
+ 1252,
298
+ 1316,
299
+ 1236
300
+ ]
301
+ ],
302
+ "output": 926
303
+ },
304
+ {
305
+ "input": [
306
+ [
307
+ 106,
308
+ 441,
309
+ 732,
310
+ 944,
311
+ 345,
312
+ 134,
313
+ 985,
314
+ 522,
315
+ 51,
316
+ 242,
317
+ 685,
318
+ 270,
319
+ 710,
320
+ 946,
321
+ 769,
322
+ 870,
323
+ 910,
324
+ 453,
325
+ 753,
326
+ 495,
327
+ 794,
328
+ 779,
329
+ 553,
330
+ 821,
331
+ 359,
332
+ 604,
333
+ 964,
334
+ 885,
335
+ 919,
336
+ 341,
337
+ 454,
338
+ 829,
339
+ 473,
340
+ 39,
341
+ 135,
342
+ 560,
343
+ 189,
344
+ 590,
345
+ 584
346
+ ],
347
+ [
348
+ 569,
349
+ 904,
350
+ 1195,
351
+ 1407,
352
+ 808,
353
+ 597,
354
+ 1448,
355
+ 985,
356
+ 514,
357
+ 705,
358
+ 1148,
359
+ 733,
360
+ 1173,
361
+ 1409,
362
+ 1232,
363
+ 1333,
364
+ 1373,
365
+ 916,
366
+ 1216,
367
+ 958,
368
+ 1257,
369
+ 1242,
370
+ 1016,
371
+ 1284,
372
+ 822,
373
+ 1067,
374
+ 1427,
375
+ 1348,
376
+ 1382,
377
+ 804,
378
+ 917,
379
+ 1292,
380
+ 936,
381
+ 502,
382
+ 598,
383
+ 1023,
384
+ 652,
385
+ 1053,
386
+ 1047
387
+ ]
388
+ ],
389
+ "output": 463
390
+ },
391
+ {
392
+ "input": [
393
+ [
394
+ 181,
395
+ 844,
396
+ 69,
397
+ 52,
398
+ 815,
399
+ 368,
400
+ 150,
401
+ 273,
402
+ 872,
403
+ 972,
404
+ 198,
405
+ 926,
406
+ 818,
407
+ 534,
408
+ 488,
409
+ 182,
410
+ 708,
411
+ 254,
412
+ 89,
413
+ 601,
414
+ 769,
415
+ 401,
416
+ 340,
417
+ 593,
418
+ 28,
419
+ 429,
420
+ 25,
421
+ 624,
422
+ 594,
423
+ 406,
424
+ 479,
425
+ 171,
426
+ 556,
427
+ 757,
428
+ 988,
429
+ 478,
430
+ 763,
431
+ 833,
432
+ 795,
433
+ 382,
434
+ 374,
435
+ 936,
436
+ 572,
437
+ 509,
438
+ 169,
439
+ 781,
440
+ 745,
441
+ 538,
442
+ 905,
443
+ 632,
444
+ 868,
445
+ 274,
446
+ 758,
447
+ 955,
448
+ 468,
449
+ 771,
450
+ 192,
451
+ 627,
452
+ 77,
453
+ 606,
454
+ 971,
455
+ 571,
456
+ 409,
457
+ 381,
458
+ 932,
459
+ 810,
460
+ 508,
461
+ 143,
462
+ 735,
463
+ 616,
464
+ 233,
465
+ 367,
466
+ 396,
467
+ 413,
468
+ 119,
469
+ 970,
470
+ 96,
471
+ 637,
472
+ 325,
473
+ 188,
474
+ 421,
475
+ 551,
476
+ 547,
477
+ 443,
478
+ 570,
479
+ 428
480
+ ],
481
+ [
482
+ 808,
483
+ 1471,
484
+ 696,
485
+ 679,
486
+ 1442,
487
+ 995,
488
+ 777,
489
+ 900,
490
+ 1499,
491
+ 1599,
492
+ 825,
493
+ 1553,
494
+ 1445,
495
+ 1161,
496
+ 1115,
497
+ 809,
498
+ 1335,
499
+ 881,
500
+ 716,
501
+ 1228,
502
+ 1396,
503
+ 1028,
504
+ 967,
505
+ 1220,
506
+ 655,
507
+ 1056,
508
+ 652,
509
+ 1251,
510
+ 1221,
511
+ 1033,
512
+ 1106,
513
+ 798,
514
+ 1183,
515
+ 1384,
516
+ 1615,
517
+ 1105,
518
+ 1390,
519
+ 1460,
520
+ 1422,
521
+ 1009,
522
+ 1001,
523
+ 1563,
524
+ 1199,
525
+ 1136,
526
+ 796,
527
+ 1408,
528
+ 1372,
529
+ 1165,
530
+ 1532,
531
+ 1259,
532
+ 1495,
533
+ 901,
534
+ 1385,
535
+ 1582,
536
+ 1095,
537
+ 1398,
538
+ 819,
539
+ 1254,
540
+ 704,
541
+ 1233,
542
+ 1598,
543
+ 1198,
544
+ 1036,
545
+ 1008,
546
+ 1559,
547
+ 1437,
548
+ 1135,
549
+ 770,
550
+ 1362,
551
+ 1243,
552
+ 860,
553
+ 994,
554
+ 1023,
555
+ 1040,
556
+ 746,
557
+ 1597,
558
+ 723,
559
+ 1264,
560
+ 952,
561
+ 815,
562
+ 1048,
563
+ 1178,
564
+ 1174,
565
+ 1070,
566
+ 1197,
567
+ 1055
568
+ ]
569
+ ],
570
+ "output": 627
571
+ },
572
+ {
573
+ "input": [
574
+ [
575
+ 553,
576
+ 442,
577
+ 222,
578
+ 424,
579
+ 602,
580
+ 283,
581
+ 297,
582
+ 580,
583
+ 513,
584
+ 175,
585
+ 25,
586
+ 6,
587
+ 446,
588
+ 346,
589
+ 973,
590
+ 353,
591
+ 451,
592
+ 151,
593
+ 35,
594
+ 948,
595
+ 283,
596
+ 303,
597
+ 765,
598
+ 559,
599
+ 510,
600
+ 354,
601
+ 19,
602
+ 951,
603
+ 206,
604
+ 363,
605
+ 856,
606
+ 407,
607
+ 233,
608
+ 127,
609
+ 175,
610
+ 393,
611
+ 472,
612
+ 189,
613
+ 859,
614
+ 355,
615
+ 160,
616
+ 78,
617
+ 264,
618
+ 853,
619
+ 745,
620
+ 134,
621
+ 558,
622
+ 521,
623
+ 145,
624
+ 80,
625
+ 629,
626
+ 425,
627
+ 41,
628
+ 620,
629
+ 116,
630
+ 265,
631
+ 876,
632
+ 686,
633
+ 210,
634
+ 27,
635
+ 159,
636
+ 397,
637
+ 561,
638
+ 530,
639
+ 713,
640
+ 24,
641
+ 204,
642
+ 67,
643
+ 317,
644
+ 197,
645
+ 566,
646
+ 555,
647
+ 19,
648
+ 324,
649
+ 190,
650
+ 745,
651
+ 6,
652
+ 165,
653
+ 910,
654
+ 289
655
+ ],
656
+ [
657
+ 1244,
658
+ 1133,
659
+ 913,
660
+ 1115,
661
+ 1293,
662
+ 974,
663
+ 988,
664
+ 1271,
665
+ 1204,
666
+ 866,
667
+ 716,
668
+ 697,
669
+ 1137,
670
+ 1037,
671
+ 1664,
672
+ 1044,
673
+ 1142,
674
+ 842,
675
+ 726,
676
+ 1639,
677
+ 974,
678
+ 994,
679
+ 1456,
680
+ 1250,
681
+ 1201,
682
+ 1045,
683
+ 710,
684
+ 1642,
685
+ 897,
686
+ 1054,
687
+ 1547,
688
+ 1098,
689
+ 924,
690
+ 818,
691
+ 866,
692
+ 1084,
693
+ 1163,
694
+ 880,
695
+ 1550,
696
+ 1046,
697
+ 851,
698
+ 769,
699
+ 955,
700
+ 1544,
701
+ 1436,
702
+ 825,
703
+ 1249,
704
+ 1212,
705
+ 836,
706
+ 771,
707
+ 1320,
708
+ 1116,
709
+ 732,
710
+ 1311,
711
+ 807,
712
+ 956,
713
+ 1567,
714
+ 1377,
715
+ 901,
716
+ 718,
717
+ 850,
718
+ 1088,
719
+ 1252,
720
+ 1221,
721
+ 1404,
722
+ 715,
723
+ 895,
724
+ 758,
725
+ 1008,
726
+ 888,
727
+ 1257,
728
+ 1246,
729
+ 710,
730
+ 1015,
731
+ 881,
732
+ 1436,
733
+ 697,
734
+ 856,
735
+ 1601,
736
+ 980
737
+ ]
738
+ ],
739
+ "output": 691
740
+ },
741
+ {
742
+ "input": [
743
+ [
744
+ 24,
745
+ 9,
746
+ 953,
747
+ 877,
748
+ 639,
749
+ 686,
750
+ 942,
751
+ 589,
752
+ 107,
753
+ 347,
754
+ 881,
755
+ 965,
756
+ 500,
757
+ 187,
758
+ 855,
759
+ 854,
760
+ 641,
761
+ 51,
762
+ 742,
763
+ 81,
764
+ 357,
765
+ 659,
766
+ 562,
767
+ 250,
768
+ 670,
769
+ 298,
770
+ 316,
771
+ 45,
772
+ 455,
773
+ 750,
774
+ 992,
775
+ 166,
776
+ 121,
777
+ 668,
778
+ 525,
779
+ 320,
780
+ 69,
781
+ 415,
782
+ 537,
783
+ 323,
784
+ 228,
785
+ 903,
786
+ 777,
787
+ 910,
788
+ 459,
789
+ 54,
790
+ 411,
791
+ 286,
792
+ 357,
793
+ 629,
794
+ 113,
795
+ 497,
796
+ 333,
797
+ 660,
798
+ 680,
799
+ 431,
800
+ 241,
801
+ 101,
802
+ 866,
803
+ 215,
804
+ 885,
805
+ 343,
806
+ 15,
807
+ 613,
808
+ 459,
809
+ 311,
810
+ 147,
811
+ 346,
812
+ 293,
813
+ 393,
814
+ 780,
815
+ 646,
816
+ 721,
817
+ 127,
818
+ 641,
819
+ 965,
820
+ 882,
821
+ 771
822
+ ],
823
+ [
824
+ 916,
825
+ 901,
826
+ 1845,
827
+ 1769,
828
+ 1531,
829
+ 1578,
830
+ 1834,
831
+ 1481,
832
+ 999,
833
+ 1239,
834
+ 1773,
835
+ 1857,
836
+ 1392,
837
+ 1079,
838
+ 1747,
839
+ 1746,
840
+ 1533,
841
+ 943,
842
+ 1634,
843
+ 973,
844
+ 1249,
845
+ 1551,
846
+ 1454,
847
+ 1142,
848
+ 1562,
849
+ 1190,
850
+ 1208,
851
+ 937,
852
+ 1347,
853
+ 1642,
854
+ 1884,
855
+ 1058,
856
+ 1013,
857
+ 1560,
858
+ 1417,
859
+ 1212,
860
+ 961,
861
+ 1307,
862
+ 1429,
863
+ 1215,
864
+ 1120,
865
+ 1795,
866
+ 1669,
867
+ 1802,
868
+ 1351,
869
+ 946,
870
+ 1303,
871
+ 1178,
872
+ 1249,
873
+ 1521,
874
+ 1005,
875
+ 1389,
876
+ 1225,
877
+ 1552,
878
+ 1572,
879
+ 1323,
880
+ 1133,
881
+ 993,
882
+ 1758,
883
+ 1107,
884
+ 1777,
885
+ 1235,
886
+ 907,
887
+ 1505,
888
+ 1351,
889
+ 1203,
890
+ 1039,
891
+ 1238,
892
+ 1185,
893
+ 1285,
894
+ 1672,
895
+ 1538,
896
+ 1613,
897
+ 1019,
898
+ 1533,
899
+ 1857,
900
+ 1774,
901
+ 1663
902
+ ]
903
+ ],
904
+ "output": 892
905
+ },
906
+ {
907
+ "input": [
908
+ [
909
+ 771,
910
+ 471,
911
+ 733,
912
+ 559,
913
+ 790,
914
+ 63,
915
+ 458,
916
+ 44,
917
+ 859,
918
+ 715,
919
+ 431,
920
+ 142,
921
+ 592,
922
+ 75,
923
+ 779,
924
+ 117,
925
+ 763,
926
+ 489,
927
+ 599,
928
+ 921,
929
+ 690,
930
+ 370,
931
+ 86,
932
+ 317,
933
+ 487,
934
+ 996,
935
+ 920,
936
+ 852,
937
+ 173,
938
+ 307,
939
+ 462,
940
+ 741,
941
+ 539,
942
+ 263,
943
+ 525,
944
+ 594,
945
+ 5,
946
+ 118,
947
+ 323,
948
+ 246,
949
+ 668,
950
+ 852,
951
+ 456,
952
+ 996,
953
+ 723,
954
+ 956,
955
+ 848,
956
+ 896,
957
+ 983,
958
+ 779,
959
+ 31,
960
+ 485,
961
+ 118,
962
+ 379,
963
+ 440,
964
+ 179,
965
+ 190,
966
+ 309,
967
+ 506,
968
+ 628,
969
+ 265,
970
+ 291,
971
+ 361,
972
+ 936,
973
+ 474,
974
+ 324,
975
+ 64,
976
+ 182,
977
+ 714,
978
+ 39,
979
+ 695,
980
+ 737,
981
+ 944,
982
+ 926,
983
+ 442,
984
+ 702,
985
+ 275,
986
+ 871,
987
+ 161
988
+ ],
989
+ [
990
+ 729,
991
+ 429,
992
+ 691,
993
+ 517,
994
+ 748,
995
+ 21,
996
+ 416,
997
+ 2,
998
+ 817,
999
+ 673,
1000
+ 389,
1001
+ 100,
1002
+ 550,
1003
+ 33,
1004
+ 737,
1005
+ 75,
1006
+ 721,
1007
+ 447,
1008
+ 557,
1009
+ 879,
1010
+ 648,
1011
+ 328,
1012
+ 44,
1013
+ 275,
1014
+ 445,
1015
+ 954,
1016
+ 878,
1017
+ 810,
1018
+ 131,
1019
+ 265,
1020
+ 420,
1021
+ 699,
1022
+ 497,
1023
+ 221,
1024
+ 483,
1025
+ 552,
1026
+ -37,
1027
+ 76,
1028
+ 281,
1029
+ 204,
1030
+ 626,
1031
+ 810,
1032
+ 414,
1033
+ 954,
1034
+ 681,
1035
+ 914,
1036
+ 806,
1037
+ 854,
1038
+ 941,
1039
+ 737,
1040
+ -11,
1041
+ 443,
1042
+ 76,
1043
+ 337,
1044
+ 398,
1045
+ 137,
1046
+ 148,
1047
+ 267,
1048
+ 464,
1049
+ 586,
1050
+ 223,
1051
+ 249,
1052
+ 319,
1053
+ 894,
1054
+ 432,
1055
+ 282,
1056
+ 22,
1057
+ 140,
1058
+ 672,
1059
+ -3,
1060
+ 653,
1061
+ 695,
1062
+ 902,
1063
+ 884,
1064
+ 400,
1065
+ 660,
1066
+ 233,
1067
+ 829,
1068
+ 119
1069
+ ]
1070
+ ],
1071
+ "output": -42
1072
+ },
1073
+ {
1074
+ "input": [
1075
+ [
1076
+ 494,
1077
+ 93,
1078
+ 976,
1079
+ 743,
1080
+ 397,
1081
+ 829,
1082
+ 935,
1083
+ 849,
1084
+ 282,
1085
+ 831,
1086
+ 890,
1087
+ 292,
1088
+ 542,
1089
+ 253,
1090
+ 302,
1091
+ 693,
1092
+ 855,
1093
+ 202,
1094
+ 73,
1095
+ 882,
1096
+ 210,
1097
+ 363,
1098
+ 224,
1099
+ 379,
1100
+ 139,
1101
+ 942,
1102
+ 417,
1103
+ 941,
1104
+ 621,
1105
+ 693,
1106
+ 961,
1107
+ 947,
1108
+ 972,
1109
+ 659,
1110
+ 970,
1111
+ 371,
1112
+ 555,
1113
+ 389,
1114
+ 103,
1115
+ 552,
1116
+ 223
1117
+ ],
1118
+ [
1119
+ 1400,
1120
+ 999,
1121
+ 1882,
1122
+ 1649,
1123
+ 1303,
1124
+ 1735,
1125
+ 1841,
1126
+ 1755,
1127
+ 1188,
1128
+ 1737,
1129
+ 1796,
1130
+ 1198,
1131
+ 1448,
1132
+ 1159,
1133
+ 1208,
1134
+ 1599,
1135
+ 1761,
1136
+ 1108,
1137
+ 979,
1138
+ 1788,
1139
+ 1116,
1140
+ 1269,
1141
+ 1130,
1142
+ 1285,
1143
+ 1045,
1144
+ 1848,
1145
+ 1323,
1146
+ 1847,
1147
+ 1527,
1148
+ 1599,
1149
+ 1867,
1150
+ 1853,
1151
+ 1878,
1152
+ 1565,
1153
+ 1876,
1154
+ 1277,
1155
+ 1461,
1156
+ 1295,
1157
+ 1009,
1158
+ 1458,
1159
+ 1129
1160
+ ]
1161
+ ],
1162
+ "output": 906
1163
+ }
1164
+ ],
1165
+ "haskell_template": "addedInteger :: [Int] -> [Int] -> Int\naddedInteger nums1 nums2 ",
1166
+ "ocaml_template": "let addedInteger (nums1: int list) (nums2: int list) : int = ",
1167
+ "scala_template": "def addedInteger(nums1: List[Int],nums2: List[Int]): Int = { \n \n}",
1168
+ "java_template": "class Solution {\n public int addedInteger(int[] nums1, int[] nums2) {\n \n }\n}",
1169
+ "python_template": "class Solution(object):\n def addedInteger(self, nums1, nums2):\n \"\"\"\n :type nums1: List[int]\n :type nums2: List[int]\n :rtype: int\n \"\"\"\n "
1170
+ }
find_the_integer_added_to_array_i/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 (addedInteger [2;6;4] [9;7;5])
12
+
13
+ let test2 _ = assert_equal (-5) (addedInteger [10] [5])
14
+
15
+ let test3 _ = assert_equal 0 (addedInteger [1;1;1;1] [1;1;1;1])
16
+
17
+ let test4 _ = assert_equal (-203) (addedInteger [900; 406; 917; 736; 331; 89; 81; 268; 776; 577; 299; 33; 555; 191; 54; 329; 85; 429; 623; 887; 533; 290; 806; 636; 946; 105] [697; 203; 714; 533; 128; ( -114); ( -122); 65; 573; 374; 96; ( -170); 352; ( -12); ( -149); 126; ( -118); 226; 420; 684; 330; 87; 603; 433; 743; ( -98)])
18
+
19
+ let test5 _ = assert_equal 571 (addedInteger [102; 64; 584; 874; 258; 453; 115; 505; 147; 784; 692; 257; 884; 872; 194; 380; 23; 268; 125; 419; 704; 749; 149; 458; 730; 731; 113; 649; 697; 895; 172; 384; 568; 414; 69; 407; 696; 501; 285; 478; 524; 198; 11; 942; 464; 816; 461; 869; 211] [673; 635; 1155; 1445; 829; 1024; 686; 1076; 718; 1355; 1263; 828; 1455; 1443; 765; 951; 594; 839; 696; 990; 1275; 1320; 720; 1029; 1301; 1302; 684; 1220; 1268; 1466; 743; 955; 1139; 985; 640; 978; 1267; 1072; 856; 1049; 1095; 769; 582; 1513; 1035; 1387; 1032; 1440; 782])
20
+
21
+ let test6 _ = assert_equal 581 (addedInteger [728; 220; 82] [1309; 801; 663])
22
+
23
+ let test7 _ = assert_equal 926 (addedInteger [382; 525; 20; 929; 409; 352; 407; 278; 120; 425; 299; 168; 262; 257; 274; 447; 147; 941; 307; 991; 380; 775; 384; 536; 143; 384; 600; 131; 870; 20; 937; 71; 809; 664; 524; 707; 930; 724; 730; 477; 326; 390; 310] [1308; 1451; 946; 1855; 1335; 1278; 1333; 1204; 1046; 1351; 1225; 1094; 1188; 1183; 1200; 1373; 1073; 1867; 1233; 1917; 1306; 1701; 1310; 1462; 1069; 1310; 1526; 1057; 1796; 946; 1863; 997; 1735; 1590; 1450; 1633; 1856; 1650; 1656; 1403; 1252; 1316; 1236])
24
+
25
+ let test8 _ = assert_equal 463 (addedInteger [106; 441; 732; 944; 345; 134; 985; 522; 51; 242; 685; 270; 710; 946; 769; 870; 910; 453; 753; 495; 794; 779; 553; 821; 359; 604; 964; 885; 919; 341; 454; 829; 473; 39; 135; 560; 189; 590; 584] [569; 904; 1195; 1407; 808; 597; 1448; 985; 514; 705; 1148; 733; 1173; 1409; 1232; 1333; 1373; 916; 1216; 958; 1257; 1242; 1016; 1284; 822; 1067; 1427; 1348; 1382; 804; 917; 1292; 936; 502; 598; 1023; 652; 1053; 1047])
26
+
27
+ let test9 _ = assert_equal 627 (addedInteger [181; 844; 69; 52; 815; 368; 150; 273; 872; 972; 198; 926; 818; 534; 488; 182; 708; 254; 89; 601; 769; 401; 340; 593; 28; 429; 25; 624; 594; 406; 479; 171; 556; 757; 988; 478; 763; 833; 795; 382; 374; 936; 572; 509; 169; 781; 745; 538; 905; 632; 868; 274; 758; 955; 468; 771; 192; 627; 77; 606; 971; 571; 409; 381; 932; 810; 508; 143; 735; 616; 233; 367; 396; 413; 119; 970; 96; 637; 325; 188; 421; 551; 547; 443; 570; 428] [808; 1471; 696; 679; 1442; 995; 777; 900; 1499; 1599; 825; 1553; 1445; 1161; 1115; 809; 1335; 881; 716; 1228; 1396; 1028; 967; 1220; 655; 1056; 652; 1251; 1221; 1033; 1106; 798; 1183; 1384; 1615; 1105; 1390; 1460; 1422; 1009; 1001; 1563; 1199; 1136; 796; 1408; 1372; 1165; 1532; 1259; 1495; 901; 1385; 1582; 1095; 1398; 819; 1254; 704; 1233; 1598; 1198; 1036; 1008; 1559; 1437; 1135; 770; 1362; 1243; 860; 994; 1023; 1040; 746; 1597; 723; 1264; 952; 815; 1048; 1178; 1174; 1070; 1197; 1055])
28
+
29
+ let test10 _ = assert_equal 691 (addedInteger [553; 442; 222; 424; 602; 283; 297; 580; 513; 175; 25; 6; 446; 346; 973; 353; 451; 151; 35; 948; 283; 303; 765; 559; 510; 354; 19; 951; 206; 363; 856; 407; 233; 127; 175; 393; 472; 189; 859; 355; 160; 78; 264; 853; 745; 134; 558; 521; 145; 80; 629; 425; 41; 620; 116; 265; 876; 686; 210; 27; 159; 397; 561; 530; 713; 24; 204; 67; 317; 197; 566; 555; 19; 324; 190; 745; 6; 165; 910; 289] [1244; 1133; 913; 1115; 1293; 974; 988; 1271; 1204; 866; 716; 697; 1137; 1037; 1664; 1044; 1142; 842; 726; 1639; 974; 994; 1456; 1250; 1201; 1045; 710; 1642; 897; 1054; 1547; 1098; 924; 818; 866; 1084; 1163; 880; 1550; 1046; 851; 769; 955; 1544; 1436; 825; 1249; 1212; 836; 771; 1320; 1116; 732; 1311; 807; 956; 1567; 1377; 901; 718; 850; 1088; 1252; 1221; 1404; 715; 895; 758; 1008; 888; 1257; 1246; 710; 1015; 881; 1436; 697; 856; 1601; 980])
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for addedInteger" >::: [
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
find_the_integer_added_to_array_i/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.addedInteger(List(2,6,4),List(9,7,5)), 3)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.addedInteger(List(10),List(5)), -5)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.addedInteger(List(1,1,1,1),List(1,1,1,1)), 0)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.addedInteger(List(900, 406, 917, 736, 331, 89, 81, 268, 776, 577, 299, 33, 555, 191, 54, 329, 85, 429, 623, 887, 533, 290, 806, 636, 946, 105),List(697, 203, 714, 533, 128, -114, -122, 65, 573, 374, 96, -170, 352, -12, -149, 126, -118, 226, 420, 684, 330, 87, 603, 433, 743, -98)), -203)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.addedInteger(List(102, 64, 584, 874, 258, 453, 115, 505, 147, 784, 692, 257, 884, 872, 194, 380, 23, 268, 125, 419, 704, 749, 149, 458, 730, 731, 113, 649, 697, 895, 172, 384, 568, 414, 69, 407, 696, 501, 285, 478, 524, 198, 11, 942, 464, 816, 461, 869, 211),List(673, 635, 1155, 1445, 829, 1024, 686, 1076, 718, 1355, 1263, 828, 1455, 1443, 765, 951, 594, 839, 696, 990, 1275, 1320, 720, 1029, 1301, 1302, 684, 1220, 1268, 1466, 743, 955, 1139, 985, 640, 978, 1267, 1072, 856, 1049, 1095, 769, 582, 1513, 1035, 1387, 1032, 1440, 782)), 571)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.addedInteger(List(728, 220, 82),List(1309, 801, 663)), 581)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.addedInteger(List(382, 525, 20, 929, 409, 352, 407, 278, 120, 425, 299, 168, 262, 257, 274, 447, 147, 941, 307, 991, 380, 775, 384, 536, 143, 384, 600, 131, 870, 20, 937, 71, 809, 664, 524, 707, 930, 724, 730, 477, 326, 390, 310),List(1308, 1451, 946, 1855, 1335, 1278, 1333, 1204, 1046, 1351, 1225, 1094, 1188, 1183, 1200, 1373, 1073, 1867, 1233, 1917, 1306, 1701, 1310, 1462, 1069, 1310, 1526, 1057, 1796, 946, 1863, 997, 1735, 1590, 1450, 1633, 1856, 1650, 1656, 1403, 1252, 1316, 1236)), 926)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.addedInteger(List(106, 441, 732, 944, 345, 134, 985, 522, 51, 242, 685, 270, 710, 946, 769, 870, 910, 453, 753, 495, 794, 779, 553, 821, 359, 604, 964, 885, 919, 341, 454, 829, 473, 39, 135, 560, 189, 590, 584),List(569, 904, 1195, 1407, 808, 597, 1448, 985, 514, 705, 1148, 733, 1173, 1409, 1232, 1333, 1373, 916, 1216, 958, 1257, 1242, 1016, 1284, 822, 1067, 1427, 1348, 1382, 804, 917, 1292, 936, 502, 598, 1023, 652, 1053, 1047)), 463)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.addedInteger(List(181, 844, 69, 52, 815, 368, 150, 273, 872, 972, 198, 926, 818, 534, 488, 182, 708, 254, 89, 601, 769, 401, 340, 593, 28, 429, 25, 624, 594, 406, 479, 171, 556, 757, 988, 478, 763, 833, 795, 382, 374, 936, 572, 509, 169, 781, 745, 538, 905, 632, 868, 274, 758, 955, 468, 771, 192, 627, 77, 606, 971, 571, 409, 381, 932, 810, 508, 143, 735, 616, 233, 367, 396, 413, 119, 970, 96, 637, 325, 188, 421, 551, 547, 443, 570, 428),List(808, 1471, 696, 679, 1442, 995, 777, 900, 1499, 1599, 825, 1553, 1445, 1161, 1115, 809, 1335, 881, 716, 1228, 1396, 1028, 967, 1220, 655, 1056, 652, 1251, 1221, 1033, 1106, 798, 1183, 1384, 1615, 1105, 1390, 1460, 1422, 1009, 1001, 1563, 1199, 1136, 796, 1408, 1372, 1165, 1532, 1259, 1495, 901, 1385, 1582, 1095, 1398, 819, 1254, 704, 1233, 1598, 1198, 1036, 1008, 1559, 1437, 1135, 770, 1362, 1243, 860, 994, 1023, 1040, 746, 1597, 723, 1264, 952, 815, 1048, 1178, 1174, 1070, 1197, 1055)), 627)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.addedInteger(List(553, 442, 222, 424, 602, 283, 297, 580, 513, 175, 25, 6, 446, 346, 973, 353, 451, 151, 35, 948, 283, 303, 765, 559, 510, 354, 19, 951, 206, 363, 856, 407, 233, 127, 175, 393, 472, 189, 859, 355, 160, 78, 264, 853, 745, 134, 558, 521, 145, 80, 629, 425, 41, 620, 116, 265, 876, 686, 210, 27, 159, 397, 561, 530, 713, 24, 204, 67, 317, 197, 566, 555, 19, 324, 190, 745, 6, 165, 910, 289),List(1244, 1133, 913, 1115, 1293, 974, 988, 1271, 1204, 866, 716, 697, 1137, 1037, 1664, 1044, 1142, 842, 726, 1639, 974, 994, 1456, 1250, 1201, 1045, 710, 1642, 897, 1054, 1547, 1098, 924, 818, 866, 1084, 1163, 880, 1550, 1046, 851, 769, 955, 1544, 1436, 825, 1249, 1212, 836, 771, 1320, 1116, 732, 1311, 807, 956, 1567, 1377, 901, 718, 850, 1088, 1252, 1221, 1404, 715, 895, 758, 1008, 888, 1257, 1246, 710, 1015, 881, 1436, 697, 856, 1601, 980)), 691)
42
+ }
43
+
44
+ }
find_the_integer_added_to_array_ii/haskell_tests/Main.hs ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main where
3
+ import Test.HUnit
4
+
5
+ --Program start
6
+ minimumAddedInteger :: [Int] -> [Int] -> Int
7
+ minimumAddedInteger nums1 nums2 = undefined
8
+
9
+ --Program end
10
+
11
+ -- Test cases
12
+
13
+ test1 :: Test
14
+ test1 = TestCase (assertEqual "for (minimumAddedInteger [4,20,16,12,8] [14,18,10])," (-2) (minimumAddedInteger [4,20,16,12,8] [14,18,10]))
15
+
16
+ test2 :: Test
17
+ test2 = TestCase (assertEqual "for (minimumAddedInteger [3,5,5,3] [7,7])," 2 (minimumAddedInteger [3,5,5,3] [7,7]))
18
+
19
+
20
+ -- Grouping test cases
21
+ tests :: Test
22
+ tests = TestList [TestLabel "Test1" test1]
23
+
24
+ -- Running the tests
25
+ main :: IO Counts
26
+ main = runTestTT tests
find_the_integer_added_to_array_ii/java_tests/Main.java ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ public class Main {
7
+ //Program start
8
+
9
+ //Program end
10
+
11
+ @Test
12
+ public void test1() {
13
+ assertEquals(-2, minimumAddedInteger(Arrays.asList(4,20,16,12,8), Arrays.asList(14,18,10)));
14
+ }
15
+ @Test
16
+ public void test2() {
17
+ assertEquals(2, minimumAddedInteger(Arrays.asList(3,5,5,3), Arrays.asList(7,7)));
18
+ }
19
+
20
+ }
find_the_integer_added_to_array_ii/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3399,
3
+ "name": "find_the_integer_added_to_array_ii",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/find-the-integer-added-to-array-ii/",
6
+ "date": "2024-04-21 00:00:00",
7
+ "task_description": "You are given two integer arrays `nums1` and `nums2`. From `nums1` two elements have been removed, and all other elements have been increased (or decreased in the case of negative) by an integer, represented by the variable `x`. As a result, `nums1` becomes **equal** to `nums2`. Two arrays are considered **equal** when they contain the same integers with the same frequencies. Return the **minimum** possible integer_ _`x`_ _that achieves this equivalence. **Example 1:** **Input:** nums1 = [4,20,16,12,8], nums2 = [14,18,10] **Output:** -2 **Explanation:** After removing elements at indices `[0,4]` and adding -2, `nums1` becomes `[18,14,10]`. **Example 2:** **Input:** nums1 = [3,5,5,3], nums2 = [7,7] **Output:** 2 **Explanation:** After removing elements at indices `[0,3]` and adding 2, `nums1` becomes `[7,7]`. **Constraints:** `3 <= nums1.length <= 200` `nums2.length == nums1.length - 2` `0 <= nums1[i], nums2[i] <= 1000` The test cases are generated in a way that there is an integer `x` such that `nums1` can become equal to `nums2` by removing two elements and adding `x` to each element of `nums1`.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "nums1 = [4,20,16,12,8], nums2 = [14,18,10]",
12
+ "output": "-2 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "nums1 = [3,5,5,3], nums2 = [7,7]",
17
+ "output": "2 "
18
+ }
19
+ ],
20
+ "private_test_cases": [],
21
+ "haskell_template": "minimumAddedInteger :: [Int] -> [Int] -> Int\nminimumAddedInteger nums1 nums2 ",
22
+ "ocaml_template": "let minimumAddedInteger (nums1: int list) (nums2: int list) : int = ",
23
+ "scala_template": "def minimumAddedInteger(nums1: List[Int],nums2: List[Int]): Int = { \n \n}",
24
+ "java_template": "class Solution {\n public int minimumAddedInteger(int[] nums1, int[] nums2) {\n \n }\n}",
25
+ "python_template": "class Solution(object):\n def minimumAddedInteger(self, nums1, nums2):\n \"\"\"\n :type nums1: List[int]\n :type nums2: List[int]\n :rtype: int\n \"\"\"\n "
26
+ }
find_the_integer_added_to_array_ii/ocaml_tests/main.ml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+ let minimumAddedInteger (nums1: int list) (nums2: int list) : int = failwith "Not implemented"
7
+
8
+ (* Program end *)
9
+
10
+ (* Test cases *)
11
+
12
+ let test1 _ = assert_equal (-2) (minimumAddedInteger [4;20;16;12;8] [14;18;10])
13
+
14
+ let test2 _ = assert_equal 2 (minimumAddedInteger [3;5;5;3] [7;7])
15
+
16
+
17
+ (* Grouping test cases *)
18
+ let suite = "Test Suite for minimumAddedInteger" >::: [
19
+
20
+ "test1" >:: test1;
21
+ "test2" >:: test2;
22
+ ]
23
+
24
+
25
+ (* Running the tests *)
26
+ let () = run_test_tt_main suite
27
+ end
find_the_integer_added_to_array_ii/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.minimumAddedInteger(List(4,20,16,12,8),List(14,18,10)), -2)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.minimumAddedInteger(List(3,5,5,3),List(7,7)), 2)
10
+ }
11
+
12
+ }
find_the_k_or_of_an_array/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 (findKOr [7,12,9,8,9,15] 4)," 9 (findKOr [7,12,9,8,9,15] 4))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (findKOr [2,12,1,11,4,5] 6)," 0 (findKOr [2,12,1,11,4,5] 6))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (findKOr [10,8,5,9,11,6,8] 1)," 15 (findKOr [10,8,5,9,11,6,8] 1))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (findKOr [1648533913, 739042202, 1785879626, 1985895330, 1938497179, 2083817625, 2137906373, 607482366, 2139497090, 1211306194, 1451440098, 1428018439, 355179392, 867567273, 2007290007, 1501370934, 714061102, 1551074511, 96945727, 929509622, 1135809159, 1542988448, 1021030478, 1242959352, 1772533934, 1603614193, 861175795, 692176247, 783353194, 1959591709, 1126162555, 413087829, 1626623018, 581408378, 1442945698, 633498962, 1852561910, 29718451, 2137636253, 1060254606, 888942654, 835212530, 939145787, 1896614077, 1263802661, 273957592, 185269437, 978551731, 80871790, 1888955973] 28)," 805703858 (findKOr [1648533913, 739042202, 1785879626, 1985895330, 1938497179, 2083817625, 2137906373, 607482366, 2139497090, 1211306194, 1451440098, 1428018439, 355179392, 867567273, 2007290007, 1501370934, 714061102, 1551074511, 96945727, 929509622, 1135809159, 1542988448, 1021030478, 1242959352, 1772533934, 1603614193, 861175795, 692176247, 783353194, 1959591709, 1126162555, 413087829, 1626623018, 581408378, 1442945698, 633498962, 1852561910, 29718451, 2137636253, 1060254606, 888942654, 835212530, 939145787, 1896614077, 1263802661, 273957592, 185269437, 978551731, 80871790, 1888955973] 28))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (findKOr [2094801774, 1000003706, 191401077, 1868250690, 605058572, 921207058, 110886273, 689524381, 472397659, 1245355819, 1072622617, 1667855563, 2086101028, 931461741, 133668135, 2109255919, 1695455737, 1722743835, 1838888788, 930017017, 1334348148] 6)," 2147483647 (findKOr [2094801774, 1000003706, 191401077, 1868250690, 605058572, 921207058, 110886273, 689524381, 472397659, 1245355819, 1072622617, 1667855563, 2086101028, 931461741, 133668135, 2109255919, 1695455737, 1722743835, 1838888788, 930017017, 1334348148] 6))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (findKOr [780191350, 168140646, 420936058, 660984487, 1379018316, 1070351316, 2024236353, 1543888836, 928825715, 1703029791, 40575574, 417080673, 64194965, 1862754202, 1980953670, 2065477099, 910678444, 2005368361, 1660920801, 868634784, 2018768963, 1402325776, 651576894, 394607141, 398561412, 858830101, 1165775403, 58668551, 1560537929, 450187698, 639051754, 2022159395, 875922139, 1961386762, 132214857, 862684027, 1619425974, 1003938876, 5501992, 1128727545, 565440000, 88124935, 861374235, 392879118] 19)," 936900463 (findKOr [780191350, 168140646, 420936058, 660984487, 1379018316, 1070351316, 2024236353, 1543888836, 928825715, 1703029791, 40575574, 417080673, 64194965, 1862754202, 1980953670, 2065477099, 910678444, 2005368361, 1660920801, 868634784, 2018768963, 1402325776, 651576894, 394607141, 398561412, 858830101, 1165775403, 58668551, 1560537929, 450187698, 639051754, 2022159395, 875922139, 1961386762, 132214857, 862684027, 1619425974, 1003938876, 5501992, 1128727545, 565440000, 88124935, 861374235, 392879118] 19))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (findKOr [731755076, 2053086872, 1018575628, 1730381497, 43893839, 612083294, 703689179, 444252405, 1498243595, 360790673, 1259742586, 817182236, 1675763739, 1306519799, 1363720032, 871373105, 377711529, 808812862, 871458331, 393291355, 972729127, 2104553726, 1153137437, 294332286, 350472015, 1786896387, 1306022224, 3997152, 460678106, 965517784, 1444058629, 63191524, 8617759, 699512756, 1023331984, 607409727, 1346067472, 367806211, 230240860, 194385732, 668640959, 1570392269, 1059119747, 485851950, 1894253672, 1796983586] 30)," 1048576 (findKOr [731755076, 2053086872, 1018575628, 1730381497, 43893839, 612083294, 703689179, 444252405, 1498243595, 360790673, 1259742586, 817182236, 1675763739, 1306519799, 1363720032, 871373105, 377711529, 808812862, 871458331, 393291355, 972729127, 2104553726, 1153137437, 294332286, 350472015, 1786896387, 1306022224, 3997152, 460678106, 965517784, 1444058629, 63191524, 8617759, 699512756, 1023331984, 607409727, 1346067472, 367806211, 230240860, 194385732, 668640959, 1570392269, 1059119747, 485851950, 1894253672, 1796983586] 30))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (findKOr [1556185915, 1742521476, 910647702, 1292062328, 1782772531, 489573838, 1467627381, 676127857] 7)," 0 (findKOr [1556185915, 1742521476, 910647702, 1292062328, 1782772531, 489573838, 1467627381, 676127857] 7))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (findKOr [1718071414, 481017583, 1122611758] 3)," 2207782 (findKOr [1718071414, 481017583, 1122611758] 3))
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
find_the_k_or_of_an_array/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(9, findKOr(new ArrayList<>(Arrays.asList(7,12,9,8,9,15)), 4));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(0, findKOr(new ArrayList<>(Arrays.asList(2,12,1,11,4,5)), 6));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(15, findKOr(new ArrayList<>(Arrays.asList(10,8,5,9,11,6,8)), 1));
23
+ }
24
+
25
+ }
find_the_k_or_of_an_array/meta.json ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3183,
3
+ "name": "find_the_k_or_of_an_array",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/find-the-k-or-of-an-array/",
6
+ "date": "2023-10-22 00:00:00",
7
+ "task_description": "You are given an integer array `nums`, and an integer `k`. Let's introduce **K-or** operation by extending the standard bitwise OR. In K-or, a bit position in the result is set to `1` if at least `k` numbers in `nums` have a `1` in that position. Return _the K-or of_ `nums`. **Example 1: ** **Input:** nums = [7,12,9,8,9,15], k = 4 **Output:** 9 **Explanation: ** Represent numbers in binary: Number Bit 3 Bit 2 Bit 1 Bit 0 7 0 1 1 1 12 1 1 0 0 9 1 0 0 1 8 1 0 0 0 9 1 0 0 1 15 1 1 1 1 Result = 9 1 0 0 1 Bit 0 is set in 7, 9, 9, and 15. Bit 3 is set in 12, 9, 8, 9, and 15. Only bits 0 and 3 qualify. The result is `(1001)2 = 9`. **Example 2: ** **Input:** nums = [2,12,1,11,4,5], k = 6 **Output:** 0 **Explanation: **No bit appears as 1 in all six array numbers, as required for K-or with `k = 6`. Thus, the result is 0. **Example 3: ** **Input:** nums = [10,8,5,9,11,6,8], k = 1 **Output:** 15 **Explanation: ** Since `k == 1`, the 1-or of the array is equal to the bitwise OR of all its elements. Hence, the answer is `10 OR 8 OR 5 OR 9 OR 11 OR 6 OR 8 = 15`. **Constraints:** `1 <= nums.length <= 50` `0 <= nums[i] < 231` `1 <= k <= nums.length`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "nums = [7,12,9,8,9,15], k = 4",
12
+ "output": "9 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "nums = [2,12,1,11,4,5], k = 6",
17
+ "output": "0 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "nums = [10,8,5,9,11,6,8], k = 1",
22
+ "output": "15 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ [
29
+ 1648533913,
30
+ 739042202,
31
+ 1785879626,
32
+ 1985895330,
33
+ 1938497179,
34
+ 2083817625,
35
+ 2137906373,
36
+ 607482366,
37
+ 2139497090,
38
+ 1211306194,
39
+ 1451440098,
40
+ 1428018439,
41
+ 355179392,
42
+ 867567273,
43
+ 2007290007,
44
+ 1501370934,
45
+ 714061102,
46
+ 1551074511,
47
+ 96945727,
48
+ 929509622,
49
+ 1135809159,
50
+ 1542988448,
51
+ 1021030478,
52
+ 1242959352,
53
+ 1772533934,
54
+ 1603614193,
55
+ 861175795,
56
+ 692176247,
57
+ 783353194,
58
+ 1959591709,
59
+ 1126162555,
60
+ 413087829,
61
+ 1626623018,
62
+ 581408378,
63
+ 1442945698,
64
+ 633498962,
65
+ 1852561910,
66
+ 29718451,
67
+ 2137636253,
68
+ 1060254606,
69
+ 888942654,
70
+ 835212530,
71
+ 939145787,
72
+ 1896614077,
73
+ 1263802661,
74
+ 273957592,
75
+ 185269437,
76
+ 978551731,
77
+ 80871790,
78
+ 1888955973
79
+ ],
80
+ 28
81
+ ],
82
+ "output": 805703858
83
+ },
84
+ {
85
+ "input": [
86
+ [
87
+ 2094801774,
88
+ 1000003706,
89
+ 191401077,
90
+ 1868250690,
91
+ 605058572,
92
+ 921207058,
93
+ 110886273,
94
+ 689524381,
95
+ 472397659,
96
+ 1245355819,
97
+ 1072622617,
98
+ 1667855563,
99
+ 2086101028,
100
+ 931461741,
101
+ 133668135,
102
+ 2109255919,
103
+ 1695455737,
104
+ 1722743835,
105
+ 1838888788,
106
+ 930017017,
107
+ 1334348148
108
+ ],
109
+ 6
110
+ ],
111
+ "output": 2147483647
112
+ },
113
+ {
114
+ "input": [
115
+ [
116
+ 780191350,
117
+ 168140646,
118
+ 420936058,
119
+ 660984487,
120
+ 1379018316,
121
+ 1070351316,
122
+ 2024236353,
123
+ 1543888836,
124
+ 928825715,
125
+ 1703029791,
126
+ 40575574,
127
+ 417080673,
128
+ 64194965,
129
+ 1862754202,
130
+ 1980953670,
131
+ 2065477099,
132
+ 910678444,
133
+ 2005368361,
134
+ 1660920801,
135
+ 868634784,
136
+ 2018768963,
137
+ 1402325776,
138
+ 651576894,
139
+ 394607141,
140
+ 398561412,
141
+ 858830101,
142
+ 1165775403,
143
+ 58668551,
144
+ 1560537929,
145
+ 450187698,
146
+ 639051754,
147
+ 2022159395,
148
+ 875922139,
149
+ 1961386762,
150
+ 132214857,
151
+ 862684027,
152
+ 1619425974,
153
+ 1003938876,
154
+ 5501992,
155
+ 1128727545,
156
+ 565440000,
157
+ 88124935,
158
+ 861374235,
159
+ 392879118
160
+ ],
161
+ 19
162
+ ],
163
+ "output": 936900463
164
+ },
165
+ {
166
+ "input": [
167
+ [
168
+ 731755076,
169
+ 2053086872,
170
+ 1018575628,
171
+ 1730381497,
172
+ 43893839,
173
+ 612083294,
174
+ 703689179,
175
+ 444252405,
176
+ 1498243595,
177
+ 360790673,
178
+ 1259742586,
179
+ 817182236,
180
+ 1675763739,
181
+ 1306519799,
182
+ 1363720032,
183
+ 871373105,
184
+ 377711529,
185
+ 808812862,
186
+ 871458331,
187
+ 393291355,
188
+ 972729127,
189
+ 2104553726,
190
+ 1153137437,
191
+ 294332286,
192
+ 350472015,
193
+ 1786896387,
194
+ 1306022224,
195
+ 3997152,
196
+ 460678106,
197
+ 965517784,
198
+ 1444058629,
199
+ 63191524,
200
+ 8617759,
201
+ 699512756,
202
+ 1023331984,
203
+ 607409727,
204
+ 1346067472,
205
+ 367806211,
206
+ 230240860,
207
+ 194385732,
208
+ 668640959,
209
+ 1570392269,
210
+ 1059119747,
211
+ 485851950,
212
+ 1894253672,
213
+ 1796983586
214
+ ],
215
+ 30
216
+ ],
217
+ "output": 1048576
218
+ },
219
+ {
220
+ "input": [
221
+ [
222
+ 1556185915,
223
+ 1742521476,
224
+ 910647702,
225
+ 1292062328,
226
+ 1782772531,
227
+ 489573838,
228
+ 1467627381,
229
+ 676127857
230
+ ],
231
+ 7
232
+ ],
233
+ "output": 0
234
+ },
235
+ {
236
+ "input": [
237
+ [
238
+ 1718071414,
239
+ 481017583,
240
+ 1122611758
241
+ ],
242
+ 3
243
+ ],
244
+ "output": 2207782
245
+ },
246
+ {
247
+ "input": [
248
+ [
249
+ 774289984,
250
+ 1107889849,
251
+ 1944693499,
252
+ 123988584,
253
+ 279943207,
254
+ 321549421,
255
+ 1546515350,
256
+ 1650394480,
257
+ 1154249583,
258
+ 2144325791,
259
+ 1144650598,
260
+ 1812138164,
261
+ 1305848768
262
+ ],
263
+ 6
264
+ ],
265
+ "output": 1181743871
266
+ },
267
+ {
268
+ "input": [
269
+ [
270
+ 932048731,
271
+ 834954976,
272
+ 367798176,
273
+ 1312529812,
274
+ 2135133903,
275
+ 1942612593,
276
+ 1796801727,
277
+ 1353590884,
278
+ 458122298,
279
+ 968110358,
280
+ 733219568,
281
+ 1809671562,
282
+ 878498281,
283
+ 1232321444,
284
+ 244260500,
285
+ 1965914122,
286
+ 722750073,
287
+ 1613109056,
288
+ 1100993663,
289
+ 755259826,
290
+ 47073101,
291
+ 26382134,
292
+ 1629490391,
293
+ 1165988131,
294
+ 1659637168,
295
+ 1538913622,
296
+ 1698379066,
297
+ 1851309574,
298
+ 479783505,
299
+ 675137206,
300
+ 1502854334,
301
+ 833814313,
302
+ 1578325030,
303
+ 134312159,
304
+ 1008333081
305
+ ],
306
+ 8
307
+ ],
308
+ "output": 2147483647
309
+ },
310
+ {
311
+ "input": [
312
+ [
313
+ 1351135357,
314
+ 1801100179,
315
+ 34046474,
316
+ 1706030497,
317
+ 1130603189,
318
+ 1321701310,
319
+ 1783698784,
320
+ 382909781,
321
+ 1207500583,
322
+ 676964322,
323
+ 1776779489,
324
+ 588379453
325
+ ],
326
+ 9
327
+ ],
328
+ "output": 32800
329
+ },
330
+ {
331
+ "input": [
332
+ [
333
+ 1109556741,
334
+ 103117037,
335
+ 1276252326,
336
+ 1337135593,
337
+ 2000887681,
338
+ 1542568715,
339
+ 93177720,
340
+ 2109961163,
341
+ 456991723,
342
+ 14204409,
343
+ 1788721494,
344
+ 512407261,
345
+ 567120814,
346
+ 1723802788,
347
+ 78697697,
348
+ 1534889556,
349
+ 85593034,
350
+ 694539394,
351
+ 1418193236,
352
+ 1387368708,
353
+ 779466997,
354
+ 2043843957,
355
+ 1102944849,
356
+ 693907617,
357
+ 900572384,
358
+ 561390851,
359
+ 1551069353,
360
+ 1523626582,
361
+ 761004254,
362
+ 970594629,
363
+ 1436389288
364
+ ],
365
+ 5
366
+ ],
367
+ "output": 2147483647
368
+ }
369
+ ],
370
+ "haskell_template": "findKOr :: [Int] -> Int -> Int\nfindKOr nums k ",
371
+ "ocaml_template": "let findKOr (nums: int list) (k: int) : int = ",
372
+ "scala_template": "def findKOr(nums: List[Int],k: Int): Int = { \n \n}",
373
+ "java_template": "class Solution {\n public int findKOr(int[] nums, int k) {\n \n }\n}",
374
+ "python_template": "class Solution(object):\n def findKOr(self, nums, k):\n \"\"\"\n :type nums: List[int]\n :type k: int\n :rtype: int\n \"\"\"\n "
375
+ }
find_the_k_or_of_an_array/ocaml_tests/main.ml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 9 (findKOr [7;12;9;8;9;15] 4)
12
+
13
+ let test2 _ = assert_equal 0 (findKOr [2;12;1;11;4;5] 6)
14
+
15
+ let test3 _ = assert_equal 15 (findKOr [10;8;5;9;11;6;8] 1)
16
+
17
+ let test4 _ = assert_equal 805703858 (findKOr [1648533913; 739042202; 1785879626; 1985895330; 1938497179; 2083817625; 2137906373; 607482366; 2139497090; 1211306194; 1451440098; 1428018439; 355179392; 867567273; 2007290007; 1501370934; 714061102; 1551074511; 96945727; 929509622; 1135809159; 1542988448; 1021030478; 1242959352; 1772533934; 1603614193; 861175795; 692176247; 783353194; 1959591709; 1126162555; 413087829; 1626623018; 581408378; 1442945698; 633498962; 1852561910; 29718451; 2137636253; 1060254606; 888942654; 835212530; 939145787; 1896614077; 1263802661; 273957592; 185269437; 978551731; 80871790; 1888955973] 28)
18
+
19
+ let test5 _ = assert_equal 2147483647 (findKOr [2094801774; 1000003706; 191401077; 1868250690; 605058572; 921207058; 110886273; 689524381; 472397659; 1245355819; 1072622617; 1667855563; 2086101028; 931461741; 133668135; 2109255919; 1695455737; 1722743835; 1838888788; 930017017; 1334348148] 6)
20
+
21
+ let test6 _ = assert_equal 936900463 (findKOr [780191350; 168140646; 420936058; 660984487; 1379018316; 1070351316; 2024236353; 1543888836; 928825715; 1703029791; 40575574; 417080673; 64194965; 1862754202; 1980953670; 2065477099; 910678444; 2005368361; 1660920801; 868634784; 2018768963; 1402325776; 651576894; 394607141; 398561412; 858830101; 1165775403; 58668551; 1560537929; 450187698; 639051754; 2022159395; 875922139; 1961386762; 132214857; 862684027; 1619425974; 1003938876; 5501992; 1128727545; 565440000; 88124935; 861374235; 392879118] 19)
22
+
23
+ let test7 _ = assert_equal 1048576 (findKOr [731755076; 2053086872; 1018575628; 1730381497; 43893839; 612083294; 703689179; 444252405; 1498243595; 360790673; 1259742586; 817182236; 1675763739; 1306519799; 1363720032; 871373105; 377711529; 808812862; 871458331; 393291355; 972729127; 2104553726; 1153137437; 294332286; 350472015; 1786896387; 1306022224; 3997152; 460678106; 965517784; 1444058629; 63191524; 8617759; 699512756; 1023331984; 607409727; 1346067472; 367806211; 230240860; 194385732; 668640959; 1570392269; 1059119747; 485851950; 1894253672; 1796983586] 30)
24
+
25
+ let test8 _ = assert_equal 0 (findKOr [1556185915; 1742521476; 910647702; 1292062328; 1782772531; 489573838; 1467627381; 676127857] 7)
26
+
27
+ let test9 _ = assert_equal 2207782 (findKOr [1718071414; 481017583; 1122611758] 3)
28
+
29
+ let test10 _ = assert_equal 1181743871 (findKOr [774289984; 1107889849; 1944693499; 123988584; 279943207; 321549421; 1546515350; 1650394480; 1154249583; 2144325791; 1144650598; 1812138164; 1305848768] 6)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for findKOr" >::: [
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
find_the_k_or_of_an_array/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.findKOr(List(7,12,9,8,9,15),4), 9)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.findKOr(List(2,12,1,11,4,5),6), 0)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.findKOr(List(10,8,5,9,11,6,8),1), 15)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.findKOr(List(1648533913, 739042202, 1785879626, 1985895330, 1938497179, 2083817625, 2137906373, 607482366, 2139497090, 1211306194, 1451440098, 1428018439, 355179392, 867567273, 2007290007, 1501370934, 714061102, 1551074511, 96945727, 929509622, 1135809159, 1542988448, 1021030478, 1242959352, 1772533934, 1603614193, 861175795, 692176247, 783353194, 1959591709, 1126162555, 413087829, 1626623018, 581408378, 1442945698, 633498962, 1852561910, 29718451, 2137636253, 1060254606, 888942654, 835212530, 939145787, 1896614077, 1263802661, 273957592, 185269437, 978551731, 80871790, 1888955973),28), 805703858)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.findKOr(List(2094801774, 1000003706, 191401077, 1868250690, 605058572, 921207058, 110886273, 689524381, 472397659, 1245355819, 1072622617, 1667855563, 2086101028, 931461741, 133668135, 2109255919, 1695455737, 1722743835, 1838888788, 930017017, 1334348148),6), 2147483647)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.findKOr(List(780191350, 168140646, 420936058, 660984487, 1379018316, 1070351316, 2024236353, 1543888836, 928825715, 1703029791, 40575574, 417080673, 64194965, 1862754202, 1980953670, 2065477099, 910678444, 2005368361, 1660920801, 868634784, 2018768963, 1402325776, 651576894, 394607141, 398561412, 858830101, 1165775403, 58668551, 1560537929, 450187698, 639051754, 2022159395, 875922139, 1961386762, 132214857, 862684027, 1619425974, 1003938876, 5501992, 1128727545, 565440000, 88124935, 861374235, 392879118),19), 936900463)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.findKOr(List(731755076, 2053086872, 1018575628, 1730381497, 43893839, 612083294, 703689179, 444252405, 1498243595, 360790673, 1259742586, 817182236, 1675763739, 1306519799, 1363720032, 871373105, 377711529, 808812862, 871458331, 393291355, 972729127, 2104553726, 1153137437, 294332286, 350472015, 1786896387, 1306022224, 3997152, 460678106, 965517784, 1444058629, 63191524, 8617759, 699512756, 1023331984, 607409727, 1346067472, 367806211, 230240860, 194385732, 668640959, 1570392269, 1059119747, 485851950, 1894253672, 1796983586),30), 1048576)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.findKOr(List(1556185915, 1742521476, 910647702, 1292062328, 1782772531, 489573838, 1467627381, 676127857),7), 0)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.findKOr(List(1718071414, 481017583, 1122611758),3), 2207782)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.findKOr(List(774289984, 1107889849, 1944693499, 123988584, 279943207, 321549421, 1546515350, 1650394480, 1154249583, 2144325791, 1144650598, 1812138164, 1305848768),6), 1181743871)
42
+ }
43
+
44
+ }
find_the_k_sum_of_an_array/.DS_Store ADDED
Binary file (6.15 kB). View file
 
find_the_k_sum_of_an_array/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 (kSum [2,4,-2] 5)," 2 (kSum [2,4,-2] 5))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (kSum [1,-2,3,4,-10,12] 16)," 10 (kSum [1,-2,3,4,-10,12] 16))
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
find_the_k_sum_of_an_array/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, kSum(new ArrayList<>(Arrays.asList(2,4,-2)), 5));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(10, kSum(new ArrayList<>(Arrays.asList(1,-2,3,4,-10,12)), 16));
19
+ }
20
+
21
+ }
find_the_k_sum_of_an_array/meta.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8286bab721ef1dcd17d3fe083cda6754ccb92a3670235b366b47ed3d35f48b7
3
+ size 19251648
find_the_k_sum_of_an_array/ocaml_tests/main.ml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ module Main = struct
3
+ open OUnit2
4
+
5
+ (* Program start *)
6
+
7
+ (* Program end *)
8
+
9
+ (* Test cases *)
10
+
11
+ let test1 _ = assert_equal 2 (kSum [2;4;-2] 5)
12
+
13
+ let test2 _ = assert_equal 10 (kSum [1;-2;3;4;-10;12] 16)
14
+
15
+
16
+ (* Grouping test cases *)
17
+ let suite = "Test Suite for kSum" >::: [
18
+
19
+ "test1" >:: test1;
20
+ "test2" >:: test2;
21
+ ]
22
+
23
+
24
+ (* Running the tests *)
25
+ let () = run_test_tt_main suite
26
+ end
find_the_k_sum_of_an_array/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.kSum(List(2,4,-2),5), 2)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.kSum(List(1,-2,3,4,-10,12),16), 10)
10
+ }
11
+
12
+ }
find_the_k_th_character_in_string_game_ii/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 (kthCharacter 5 [0,0,0])," "a" (kthCharacter 5 [0,0,0]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (kthCharacter 10 [0,1,0,1])," "b" (kthCharacter 10 [0,1,0,1]))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (kthCharacter 73389556792057 [0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1])," "t" (kthCharacter 73389556792057 [0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1]))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (kthCharacter 21399064305792 [0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1])," "m" (kthCharacter 21399064305792 [0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1]))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (kthCharacter 43950872240933 [1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1])," "i" (kthCharacter 43950872240933 [1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1]))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (kthCharacter 72921381959823 [0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0])," "l" (kthCharacter 72921381959823 [0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0]))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (kthCharacter 42017294849779 [0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1])," "r" (kthCharacter 42017294849779 [0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1]))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (kthCharacter 81170913098282 [1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1])," "p" (kthCharacter 81170913098282 [1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1]))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (kthCharacter 40889245240878 [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1])," "i" (kthCharacter 40889245240878 [0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1]))
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
find_the_k_th_character_in_string_game_ii/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(0,0,0))", kthCharacter(5, new ArrayList<>(Arrays.asList(0,0,0))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("new ArrayList<>(Arrays.asList(0,1,0,1))", kthCharacter(10, new ArrayList<>(Arrays.asList(0,1,0,1))));
19
+ }
20
+
21
+ }
find_the_k_th_character_in_string_game_ii/meta.json ADDED
@@ -0,0 +1,690 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3601,
3
+ "name": "find_the_k_th_character_in_string_game_ii",
4
+ "difficulty": "Hard",
5
+ "link": "https://leetcode.com/problems/find-the-k-th-character-in-string-game-ii/",
6
+ "date": "2024-09-22 00:00:00",
7
+ "task_description": "Alice and Bob are playing a game. Initially, Alice has a string `word = \"a\"`. You are given a **positive** integer `k`. You are also given an integer array `operations`, where `operations[i]` represents the **type** of the `ith` operation. Now Bob will ask Alice to perform **all** operations in sequence: If `operations[i] == 0`, **append** a copy of `word` to itself. If `operations[i] == 1`, generate a new string by **changing** each character in `word` to its **next** character in the English alphabet, and **append** it to the _original_ `word`. For example, performing the operation on `\"c\"` generates `\"cd\"` and performing the operation on `\"zb\"` generates `\"zbac\"`. Return the value of the `kth` character in `word` after performing all the operations. **Note** that the character `'z'` can be changed to `'a'` in the second type of operation. **Example 1:** **Input:** k = 5, operations = [0,0,0] **Output:** \"a\" **Explanation:** Initially, `word == \"a\"`. Alice performs the three operations as follows: Appends `\"a\"` to `\"a\"`, `word` becomes `\"aa\"`. Appends `\"aa\"` to `\"aa\"`, `word` becomes `\"aaaa\"`. Appends `\"aaaa\"` to `\"aaaa\"`, `word` becomes `\"aaaaaaaa\"`. **Example 2:** **Input:** k = 10, operations = [0,1,0,1] **Output:** \"b\" **Explanation:** Initially, `word == \"a\"`. Alice performs the four operations as follows: Appends `\"a\"` to `\"a\"`, `word` becomes `\"aa\"`. Appends `\"bb\"` to `\"aa\"`, `word` becomes `\"aabb\"`. Appends `\"aabb\"` to `\"aabb\"`, `word` becomes `\"aabbaabb\"`. Appends `\"bbccbbcc\"` to `\"aabbaabb\"`, `word` becomes `\"aabbaabbbbccbbcc\"`. **Constraints:** `1 <= k <= 1014` `1 <= operations.length <= 100` `operations[i]` is either 0 or 1. The input is generated such that `word` has **at least** `k` characters after all operations.",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "k = 5, operations = [0,0,0]",
12
+ "output": "\"a\" "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "k = 10, operations = [0,1,0,1]",
17
+ "output": "\"b\" "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ 73389556792057,
24
+ [
25
+ 0,
26
+ 0,
27
+ 1,
28
+ 1,
29
+ 0,
30
+ 1,
31
+ 0,
32
+ 1,
33
+ 1,
34
+ 1,
35
+ 0,
36
+ 1,
37
+ 1,
38
+ 1,
39
+ 1,
40
+ 0,
41
+ 0,
42
+ 1,
43
+ 1,
44
+ 0,
45
+ 0,
46
+ 0,
47
+ 1,
48
+ 0,
49
+ 0,
50
+ 1,
51
+ 0,
52
+ 1,
53
+ 1,
54
+ 0,
55
+ 0,
56
+ 0,
57
+ 1,
58
+ 1,
59
+ 1,
60
+ 1,
61
+ 0,
62
+ 0,
63
+ 1,
64
+ 1,
65
+ 0,
66
+ 0,
67
+ 0,
68
+ 1,
69
+ 0,
70
+ 1,
71
+ 1,
72
+ 0,
73
+ 1,
74
+ 1,
75
+ 0,
76
+ 1,
77
+ 1
78
+ ]
79
+ ],
80
+ "output": "t"
81
+ },
82
+ {
83
+ "input": [
84
+ 21399064305792,
85
+ [
86
+ 0,
87
+ 1,
88
+ 1,
89
+ 1,
90
+ 1,
91
+ 0,
92
+ 1,
93
+ 0,
94
+ 1,
95
+ 0,
96
+ 1,
97
+ 0,
98
+ 1,
99
+ 1,
100
+ 1,
101
+ 0,
102
+ 0,
103
+ 0,
104
+ 0,
105
+ 1,
106
+ 0,
107
+ 0,
108
+ 1,
109
+ 1,
110
+ 0,
111
+ 0,
112
+ 1,
113
+ 0,
114
+ 1,
115
+ 0,
116
+ 0,
117
+ 1,
118
+ 1,
119
+ 1,
120
+ 1,
121
+ 0,
122
+ 0,
123
+ 0,
124
+ 0,
125
+ 1,
126
+ 0,
127
+ 1,
128
+ 0,
129
+ 1,
130
+ 0,
131
+ 0,
132
+ 1,
133
+ 1,
134
+ 1,
135
+ 1,
136
+ 1,
137
+ 1,
138
+ 1,
139
+ 1,
140
+ 1,
141
+ 0,
142
+ 1,
143
+ 0,
144
+ 1,
145
+ 0,
146
+ 1,
147
+ 0,
148
+ 1,
149
+ 1,
150
+ 1,
151
+ 1,
152
+ 0,
153
+ 1,
154
+ 0,
155
+ 0,
156
+ 1,
157
+ 1,
158
+ 1,
159
+ 1,
160
+ 1,
161
+ 0,
162
+ 0,
163
+ 1,
164
+ 0,
165
+ 1,
166
+ 1,
167
+ 1,
168
+ 1,
169
+ 0,
170
+ 0,
171
+ 1,
172
+ 1,
173
+ 0,
174
+ 0,
175
+ 0,
176
+ 0,
177
+ 0,
178
+ 0,
179
+ 1
180
+ ]
181
+ ],
182
+ "output": "m"
183
+ },
184
+ {
185
+ "input": [
186
+ 43950872240933,
187
+ [
188
+ 1,
189
+ 0,
190
+ 1,
191
+ 0,
192
+ 0,
193
+ 0,
194
+ 1,
195
+ 1,
196
+ 0,
197
+ 0,
198
+ 0,
199
+ 1,
200
+ 0,
201
+ 1,
202
+ 0,
203
+ 1,
204
+ 0,
205
+ 1,
206
+ 1,
207
+ 0,
208
+ 0,
209
+ 1,
210
+ 1,
211
+ 1,
212
+ 0,
213
+ 0,
214
+ 0,
215
+ 1,
216
+ 1,
217
+ 1,
218
+ 1,
219
+ 1,
220
+ 1,
221
+ 1,
222
+ 1,
223
+ 0,
224
+ 1
225
+ ]
226
+ ],
227
+ "output": "i"
228
+ },
229
+ {
230
+ "input": [
231
+ 72921381959823,
232
+ [
233
+ 0,
234
+ 1,
235
+ 0,
236
+ 0,
237
+ 1,
238
+ 1,
239
+ 1,
240
+ 0,
241
+ 0,
242
+ 0,
243
+ 0,
244
+ 1,
245
+ 1,
246
+ 1,
247
+ 0,
248
+ 1,
249
+ 1,
250
+ 0,
251
+ 1,
252
+ 1,
253
+ 0,
254
+ 0,
255
+ 0,
256
+ 0,
257
+ 1,
258
+ 0,
259
+ 0,
260
+ 0,
261
+ 1,
262
+ 1,
263
+ 1,
264
+ 1,
265
+ 0,
266
+ 1,
267
+ 1,
268
+ 0,
269
+ 1,
270
+ 0,
271
+ 0,
272
+ 0,
273
+ 1,
274
+ 0,
275
+ 0,
276
+ 1,
277
+ 0,
278
+ 0,
279
+ 1,
280
+ 0,
281
+ 1,
282
+ 0,
283
+ 0,
284
+ 1,
285
+ 1,
286
+ 0,
287
+ 0,
288
+ 0,
289
+ 1,
290
+ 1,
291
+ 1,
292
+ 1,
293
+ 0,
294
+ 1,
295
+ 1,
296
+ 0,
297
+ 1,
298
+ 1,
299
+ 1,
300
+ 1,
301
+ 1,
302
+ 0,
303
+ 1,
304
+ 0,
305
+ 1,
306
+ 0,
307
+ 1,
308
+ 1,
309
+ 1,
310
+ 1,
311
+ 1,
312
+ 1,
313
+ 1,
314
+ 0,
315
+ 0,
316
+ 1,
317
+ 1,
318
+ 1,
319
+ 0,
320
+ 0,
321
+ 0,
322
+ 0,
323
+ 0
324
+ ]
325
+ ],
326
+ "output": "l"
327
+ },
328
+ {
329
+ "input": [
330
+ 42017294849779,
331
+ [
332
+ 0,
333
+ 1,
334
+ 1,
335
+ 1,
336
+ 1,
337
+ 1,
338
+ 0,
339
+ 1,
340
+ 1,
341
+ 0,
342
+ 0,
343
+ 1,
344
+ 1,
345
+ 1,
346
+ 1,
347
+ 1,
348
+ 1,
349
+ 1,
350
+ 1,
351
+ 1,
352
+ 1,
353
+ 1,
354
+ 1,
355
+ 1,
356
+ 1,
357
+ 1,
358
+ 1,
359
+ 0,
360
+ 1,
361
+ 0,
362
+ 1,
363
+ 0,
364
+ 1,
365
+ 1,
366
+ 0,
367
+ 0,
368
+ 1,
369
+ 1,
370
+ 0,
371
+ 1
372
+ ]
373
+ ],
374
+ "output": "r"
375
+ },
376
+ {
377
+ "input": [
378
+ 81170913098282,
379
+ [
380
+ 1,
381
+ 0,
382
+ 1,
383
+ 0,
384
+ 0,
385
+ 0,
386
+ 1,
387
+ 0,
388
+ 1,
389
+ 1,
390
+ 0,
391
+ 1,
392
+ 1,
393
+ 0,
394
+ 1,
395
+ 1,
396
+ 0,
397
+ 1,
398
+ 1,
399
+ 0,
400
+ 0,
401
+ 1,
402
+ 0,
403
+ 1,
404
+ 1,
405
+ 0,
406
+ 0,
407
+ 1,
408
+ 1,
409
+ 1,
410
+ 0,
411
+ 1,
412
+ 1,
413
+ 0,
414
+ 0,
415
+ 0,
416
+ 1,
417
+ 1,
418
+ 1,
419
+ 1,
420
+ 1,
421
+ 0,
422
+ 1,
423
+ 0,
424
+ 1,
425
+ 1,
426
+ 1
427
+ ]
428
+ ],
429
+ "output": "p"
430
+ },
431
+ {
432
+ "input": [
433
+ 40889245240878,
434
+ [
435
+ 0,
436
+ 1,
437
+ 1,
438
+ 0,
439
+ 1,
440
+ 1,
441
+ 1,
442
+ 0,
443
+ 1,
444
+ 0,
445
+ 1,
446
+ 0,
447
+ 0,
448
+ 1,
449
+ 0,
450
+ 0,
451
+ 0,
452
+ 1,
453
+ 0,
454
+ 1,
455
+ 0,
456
+ 0,
457
+ 0,
458
+ 0,
459
+ 0,
460
+ 0,
461
+ 1,
462
+ 1,
463
+ 1,
464
+ 1,
465
+ 0,
466
+ 0,
467
+ 0,
468
+ 0,
469
+ 1,
470
+ 1,
471
+ 1,
472
+ 1,
473
+ 1,
474
+ 1,
475
+ 1,
476
+ 0,
477
+ 0,
478
+ 1,
479
+ 1,
480
+ 1,
481
+ 1,
482
+ 1,
483
+ 1,
484
+ 1,
485
+ 0,
486
+ 1,
487
+ 1,
488
+ 1,
489
+ 0,
490
+ 1,
491
+ 0,
492
+ 1,
493
+ 1,
494
+ 1,
495
+ 1,
496
+ 1,
497
+ 0,
498
+ 0,
499
+ 1,
500
+ 1,
501
+ 0,
502
+ 1,
503
+ 0,
504
+ 0,
505
+ 1,
506
+ 0,
507
+ 1,
508
+ 0,
509
+ 1,
510
+ 0,
511
+ 1,
512
+ 1,
513
+ 0,
514
+ 1,
515
+ 1,
516
+ 0,
517
+ 0,
518
+ 0,
519
+ 1,
520
+ 0,
521
+ 0,
522
+ 0,
523
+ 0,
524
+ 1,
525
+ 0,
526
+ 0,
527
+ 0,
528
+ 1,
529
+ 1
530
+ ]
531
+ ],
532
+ "output": "i"
533
+ },
534
+ {
535
+ "input": [
536
+ 91982926372487,
537
+ [
538
+ 1,
539
+ 1,
540
+ 1,
541
+ 1,
542
+ 1,
543
+ 0,
544
+ 0,
545
+ 1,
546
+ 0,
547
+ 0,
548
+ 0,
549
+ 1,
550
+ 1,
551
+ 0,
552
+ 1,
553
+ 1,
554
+ 0,
555
+ 0,
556
+ 0,
557
+ 0,
558
+ 1
559
+ ]
560
+ ],
561
+ "output": "h"
562
+ },
563
+ {
564
+ "input": [
565
+ 70935065236972,
566
+ [
567
+ 0,
568
+ 1,
569
+ 1,
570
+ 1,
571
+ 0,
572
+ 0,
573
+ 1,
574
+ 1,
575
+ 1,
576
+ 0,
577
+ 1,
578
+ 1,
579
+ 1,
580
+ 0,
581
+ 1,
582
+ 1,
583
+ 1,
584
+ 0,
585
+ 1,
586
+ 1,
587
+ 1,
588
+ 1,
589
+ 1,
590
+ 1,
591
+ 1
592
+ ]
593
+ ],
594
+ "output": "o"
595
+ },
596
+ {
597
+ "input": [
598
+ 35385472519380,
599
+ [
600
+ 1,
601
+ 0,
602
+ 0,
603
+ 1,
604
+ 1,
605
+ 1,
606
+ 0,
607
+ 0,
608
+ 0,
609
+ 1,
610
+ 0,
611
+ 0,
612
+ 0,
613
+ 1,
614
+ 0,
615
+ 1,
616
+ 0,
617
+ 0,
618
+ 1,
619
+ 0,
620
+ 0,
621
+ 0,
622
+ 1,
623
+ 1,
624
+ 1,
625
+ 0,
626
+ 0,
627
+ 0,
628
+ 0,
629
+ 0,
630
+ 1,
631
+ 0,
632
+ 1,
633
+ 0,
634
+ 0,
635
+ 1,
636
+ 0,
637
+ 1,
638
+ 1,
639
+ 1,
640
+ 0,
641
+ 0,
642
+ 0,
643
+ 0,
644
+ 1,
645
+ 0,
646
+ 0,
647
+ 0,
648
+ 0,
649
+ 1,
650
+ 1,
651
+ 0,
652
+ 0,
653
+ 0,
654
+ 1,
655
+ 0,
656
+ 1,
657
+ 1,
658
+ 1,
659
+ 1,
660
+ 1,
661
+ 0,
662
+ 0,
663
+ 0,
664
+ 0,
665
+ 1,
666
+ 1,
667
+ 1,
668
+ 1,
669
+ 1,
670
+ 0,
671
+ 0,
672
+ 1,
673
+ 1,
674
+ 1,
675
+ 1,
676
+ 0,
677
+ 1,
678
+ 0,
679
+ 0
680
+ ]
681
+ ],
682
+ "output": "h"
683
+ }
684
+ ],
685
+ "haskell_template": "kthCharacter :: Int -> [Int] -> String\nkthCharacter k operations ",
686
+ "ocaml_template": "let kthCharacter (k: int) (operations: int list) : string = ",
687
+ "scala_template": "def kthCharacter(k: Int,operations: List[Int]): String = { \n \n}",
688
+ "java_template": "class Solution {\n public char kthCharacter(long k, int[] operations) {\n \n }\n}",
689
+ "python_template": "class Solution(object):\n def kthCharacter(self, k, operations):\n \"\"\"\n :type k: int\n :type operations: List[int]\n :rtype: str\n \"\"\"\n "
690
+ }
find_the_k_th_character_in_string_game_ii/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 "a" (kthCharacter 5 [0;0;0])
12
+
13
+ let test2 _ = assert_equal "b" (kthCharacter 10 [0;1;0;1])
14
+
15
+ let test3 _ = assert_equal "t" (kthCharacter 73389556792057 [0; 0; 1; 1; 0; 1; 0; 1; 1; 1; 0; 1; 1; 1; 1; 0; 0; 1; 1; 0; 0; 0; 1; 0; 0; 1; 0; 1; 1; 0; 0; 0; 1; 1; 1; 1; 0; 0; 1; 1; 0; 0; 0; 1; 0; 1; 1; 0; 1; 1; 0; 1; 1])
16
+
17
+ let test4 _ = assert_equal "m" (kthCharacter 21399064305792 [0; 1; 1; 1; 1; 0; 1; 0; 1; 0; 1; 0; 1; 1; 1; 0; 0; 0; 0; 1; 0; 0; 1; 1; 0; 0; 1; 0; 1; 0; 0; 1; 1; 1; 1; 0; 0; 0; 0; 1; 0; 1; 0; 1; 0; 0; 1; 1; 1; 1; 1; 1; 1; 1; 1; 0; 1; 0; 1; 0; 1; 0; 1; 1; 1; 1; 0; 1; 0; 0; 1; 1; 1; 1; 1; 0; 0; 1; 0; 1; 1; 1; 1; 0; 0; 1; 1; 0; 0; 0; 0; 0; 0; 1])
18
+
19
+ let test5 _ = assert_equal "i" (kthCharacter 43950872240933 [1; 0; 1; 0; 0; 0; 1; 1; 0; 0; 0; 1; 0; 1; 0; 1; 0; 1; 1; 0; 0; 1; 1; 1; 0; 0; 0; 1; 1; 1; 1; 1; 1; 1; 1; 0; 1])
20
+
21
+ let test6 _ = assert_equal "l" (kthCharacter 72921381959823 [0; 1; 0; 0; 1; 1; 1; 0; 0; 0; 0; 1; 1; 1; 0; 1; 1; 0; 1; 1; 0; 0; 0; 0; 1; 0; 0; 0; 1; 1; 1; 1; 0; 1; 1; 0; 1; 0; 0; 0; 1; 0; 0; 1; 0; 0; 1; 0; 1; 0; 0; 1; 1; 0; 0; 0; 1; 1; 1; 1; 0; 1; 1; 0; 1; 1; 1; 1; 1; 0; 1; 0; 1; 0; 1; 1; 1; 1; 1; 1; 1; 0; 0; 1; 1; 1; 0; 0; 0; 0; 0])
22
+
23
+ let test7 _ = assert_equal "r" (kthCharacter 42017294849779 [0; 1; 1; 1; 1; 1; 0; 1; 1; 0; 0; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 0; 1; 0; 1; 0; 1; 1; 0; 0; 1; 1; 0; 1])
24
+
25
+ let test8 _ = assert_equal "p" (kthCharacter 81170913098282 [1; 0; 1; 0; 0; 0; 1; 0; 1; 1; 0; 1; 1; 0; 1; 1; 0; 1; 1; 0; 0; 1; 0; 1; 1; 0; 0; 1; 1; 1; 0; 1; 1; 0; 0; 0; 1; 1; 1; 1; 1; 0; 1; 0; 1; 1; 1])
26
+
27
+ let test9 _ = assert_equal "i" (kthCharacter 40889245240878 [0; 1; 1; 0; 1; 1; 1; 0; 1; 0; 1; 0; 0; 1; 0; 0; 0; 1; 0; 1; 0; 0; 0; 0; 0; 0; 1; 1; 1; 1; 0; 0; 0; 0; 1; 1; 1; 1; 1; 1; 1; 0; 0; 1; 1; 1; 1; 1; 1; 1; 0; 1; 1; 1; 0; 1; 0; 1; 1; 1; 1; 1; 0; 0; 1; 1; 0; 1; 0; 0; 1; 0; 1; 0; 1; 0; 1; 1; 0; 1; 1; 0; 0; 0; 1; 0; 0; 0; 0; 1; 0; 0; 0; 1; 1])
28
+
29
+ let test10 _ = assert_equal "h" (kthCharacter 91982926372487 [1; 1; 1; 1; 1; 0; 0; 1; 0; 0; 0; 1; 1; 0; 1; 1; 0; 0; 0; 0; 1])
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for kthCharacter" >::: [
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
find_the_k_th_character_in_string_game_ii/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.kthCharacter(5,List(0,0,0)), "a")
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.kthCharacter(10,List(0,1,0,1)), "b")
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.kthCharacter(BigInt("73389556792057"),List(0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1)), "t")
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.kthCharacter(BigInt("21399064305792"),List(0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1)), "m")
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.kthCharacter(BigInt("43950872240933"),List(1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1)), "i")
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.kthCharacter(BigInt("72921381959823"),List(0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0)), "l")
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.kthCharacter(BigInt("42017294849779"),List(0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1)), "r")
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.kthCharacter(BigInt("81170913098282"),List(1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1)), "p")
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.kthCharacter(BigInt("40889245240878"),List(0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1)), "i")
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.kthCharacter(BigInt("91982926372487"),List(1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1)), "h")
42
+ }
43
+
44
+ }
find_the_key_of_the_numbers/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 (generateKey 1 10 1000)," 0 (generateKey 1 10 1000))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (generateKey 987 879 798)," 77 (generateKey 987 879 798))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (generateKey 3429 6843 2176)," 2123 (generateKey 3429 6843 2176))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (generateKey 6723 3143 9718)," 3113 (generateKey 6723 3143 9718))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (generateKey 6202 6801 82)," 1 (generateKey 6202 6801 82))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (generateKey 6316 146 2361)," 111 (generateKey 6316 146 2361))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (generateKey 6735 1609 3641)," 1601 (generateKey 6735 1609 3641))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (generateKey 5794 3525 9759)," 3524 (generateKey 5794 3525 9759))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (generateKey 4306 8223 7504)," 4203 (generateKey 4306 8223 7504))
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
find_the_key_of_the_numbers/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(0, generateKey(1, 10, 1000));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(77, generateKey(987, 879, 798));
19
+ }
20
+
21
+ }
find_the_key_of_the_numbers/meta.json ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3568,
3
+ "name": "find_the_key_of_the_numbers",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/find-the-key-of-the-numbers/",
6
+ "date": "2024-08-17 00:00:00",
7
+ "task_description": "You are given three **positive** integers `num1`, `num2`, and `num3`. The `key` of `num1`, `num2`, and `num3` is defined as a four-digit number such that: Initially, if any number has **less than** four digits, it is padded with **leading zeros**. The `ith` digit (`1 <= i <= 4`) of the `key` is generated by taking the **smallest** digit among the `ith` digits of `num1`, `num2`, and `num3`. Return the `key` of the three numbers **without** leading zeros (_if any_). **Example 1:** **Input:** num1 = 1, num2 = 10, num3 = 1000 **Output:** 0 **Explanation:** On padding, `num1` becomes `\"0001\"`, `num2` becomes `\"0010\"`, and `num3` remains `\"1000\"`. The `1st` digit of the `key` is `min(0, 0, 1)`. The `2nd` digit of the `key` is `min(0, 0, 0)`. The `3rd` digit of the `key` is `min(0, 1, 0)`. The `4th` digit of the `key` is `min(1, 0, 0)`. Hence, the `key` is `\"0000\"`, i.e. 0. **Example 2:** **Input:** num1 = 987, num2 = 879, num3 = 798 **Output:** 777 **Example 3:** **Input:** num1 = 1, num2 = 2, num3 = 3 **Output:** 1 **Constraints:** `1 <= num1, num2, num3 <= 9999`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "num1 = 1, num2 = 10, num3 = 1000",
12
+ "output": "0 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "num1 = 987, num2 = 879, num3 = 798",
17
+ "output": "77"
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "num1 = 1, num2 = 2, num3 = 3",
22
+ "output": ""
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ 3429,
29
+ 6843,
30
+ 2176
31
+ ],
32
+ "output": 2123
33
+ },
34
+ {
35
+ "input": [
36
+ 6723,
37
+ 3143,
38
+ 9718
39
+ ],
40
+ "output": 3113
41
+ },
42
+ {
43
+ "input": [
44
+ 6202,
45
+ 6801,
46
+ 82
47
+ ],
48
+ "output": 1
49
+ },
50
+ {
51
+ "input": [
52
+ 6316,
53
+ 146,
54
+ 2361
55
+ ],
56
+ "output": 111
57
+ },
58
+ {
59
+ "input": [
60
+ 6735,
61
+ 1609,
62
+ 3641
63
+ ],
64
+ "output": 1601
65
+ },
66
+ {
67
+ "input": [
68
+ 5794,
69
+ 3525,
70
+ 9759
71
+ ],
72
+ "output": 3524
73
+ },
74
+ {
75
+ "input": [
76
+ 4306,
77
+ 8223,
78
+ 7504
79
+ ],
80
+ "output": 4203
81
+ },
82
+ {
83
+ "input": [
84
+ 938,
85
+ 9737,
86
+ 9576
87
+ ],
88
+ "output": 536
89
+ },
90
+ {
91
+ "input": [
92
+ 3514,
93
+ 6610,
94
+ 4489
95
+ ],
96
+ "output": 3410
97
+ },
98
+ {
99
+ "input": [
100
+ 3258,
101
+ 195,
102
+ 3600
103
+ ],
104
+ "output": 100
105
+ }
106
+ ],
107
+ "haskell_template": "generateKey :: Int -> Int -> Int -> Int\ngenerateKey num1 num2 num3 ",
108
+ "ocaml_template": "let generateKey (num1: int) (num2: int) (num3: int) : int = ",
109
+ "scala_template": "def generateKey(num1: Int,num2: Int,num3: Int): Int = { \n \n}",
110
+ "java_template": "class Solution {\n public int generateKey(int num1, int num2, int num3) {\n \n }\n}",
111
+ "python_template": "class Solution(object):\n def generateKey(self, num1, num2, num3):\n \"\"\"\n :type num1: int\n :type num2: int\n :type num3: int\n :rtype: int\n \"\"\"\n "
112
+ }
find_the_key_of_the_numbers/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 0 (generateKey 1 10 1000)
12
+
13
+ let test2 _ = assert_equal 77 (generateKey 987 879 798)
14
+
15
+ let test3 _ = assert_equal 2123 (generateKey 3429 6843 2176)
16
+
17
+ let test4 _ = assert_equal 3113 (generateKey 6723 3143 9718)
18
+
19
+ let test5 _ = assert_equal 1 (generateKey 6202 6801 82)
20
+
21
+ let test6 _ = assert_equal 111 (generateKey 6316 146 2361)
22
+
23
+ let test7 _ = assert_equal 1601 (generateKey 6735 1609 3641)
24
+
25
+ let test8 _ = assert_equal 3524 (generateKey 5794 3525 9759)
26
+
27
+ let test9 _ = assert_equal 4203 (generateKey 4306 8223 7504)
28
+
29
+ let test10 _ = assert_equal 536 (generateKey 938 9737 9576)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for generateKey" >::: [
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
find_the_key_of_the_numbers/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.generateKey(1,10,1000), 0)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.generateKey(987,879,798), 77)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.generateKey(3429,6843,2176), 2123)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.generateKey(6723,3143,9718), 3113)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.generateKey(6202,6801,82), 1)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.generateKey(6316,146,2361), 111)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.generateKey(6735,1609,3641), 1601)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.generateKey(5794,3525,9759), 3524)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.generateKey(4306,8223,7504), 4203)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.generateKey(938,9737,9576), 536)
42
+ }
43
+
44
+ }
find_the_largest_almost_missing_integer/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 (largestInteger [3,9,2,1,7] 3)," 7 (largestInteger [3,9,2,1,7] 3))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (largestInteger [3,9,7,2,1,7] 4)," 3 (largestInteger [3,9,7,2,1,7] 4))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (largestInteger [0,0] 1)," (-1) (largestInteger [0,0] 1))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (largestInteger [6, 8, 14, 7, 24, 43, 43, 48, 16, 30, 10, 36, 34, 2, 9, 19, 2, 37, 36] 3)," 6 (largestInteger [6, 8, 14, 7, 24, 43, 43, 48, 16, 30, 10, 36, 34, 2, 9, 19, 2, 37, 36] 3))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (largestInteger [30, 49, 42, 15, 48, 19, 21, 31, 1, 3, 15, 38, 17, 46, 23, 42, 37, 28, 14, 14, 5, 0, 15, 30, 6, 21, 19, 15, 37] 19)," (-1) (largestInteger [30, 49, 42, 15, 48, 19, 21, 31, 1, 3, 15, 38, 17, 46, 23, 42, 37, 28, 14, 14, 5, 0, 15, 30, 6, 21, 19, 15, 37] 19))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (largestInteger [33, 25, 46, 21, 30, 32, 49, 24, 9, 13, 16, 6, 16, 22, 30, 48, 13, 31, 13, 34, 26, 1, 45, 45, 22, 11, 38, 10, 38, 12, 15, 27, 10] 26)," 33 (largestInteger [33, 25, 46, 21, 30, 32, 49, 24, 9, 13, 16, 6, 16, 22, 30, 48, 13, 31, 13, 34, 26, 1, 45, 45, 22, 11, 38, 10, 38, 12, 15, 27, 10] 26))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (largestInteger [18, 49, 2, 10, 38, 21, 5, 24, 30, 50, 22, 37, 28, 15, 40, 19, 2, 5, 50, 18, 21, 26, 12, 12, 38, 7, 39, 12, 34] 20)," 34 (largestInteger [18, 49, 2, 10, 38, 21, 5, 24, 30, 50, 22, 37, 28, 15, 40, 19, 2, 5, 50, 18, 21, 26, 12, 12, 38, 7, 39, 12, 34] 20))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (largestInteger [32, 47, 9, 39, 19, 40, 16, 10, 21, 11, 40, 32, 33, 7, 47, 12, 37, 29, 42, 37, 6, 40, 30, 31, 47, 24, 11, 16, 39, 5, 23, 44, 48, 31, 37, 13, 33, 8, 6, 32, 49, 48, 25, 9, 29, 45, 22, 19, 28, 44] 21)," (-1) (largestInteger [32, 47, 9, 39, 19, 40, 16, 10, 21, 11, 40, 32, 33, 7, 47, 12, 37, 29, 42, 37, 6, 40, 30, 31, 47, 24, 11, 16, 39, 5, 23, 44, 48, 31, 37, 13, 33, 8, 6, 32, 49, 48, 25, 9, 29, 45, 22, 19, 28, 44] 21))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (largestInteger [4, 22, 26, 40, 22, 1, 27, 42, 11, 19, 40, 23] 4)," 23 (largestInteger [4, 22, 26, 40, 22, 1, 27, 42, 11, 19, 40, 23] 4))
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
find_the_largest_almost_missing_integer/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(7, largestInteger(new ArrayList<>(Arrays.asList(3,9,2,1,7)), 3));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(3, largestInteger(new ArrayList<>(Arrays.asList(3,9,7,2,1,7)), 4));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(-1, largestInteger(new ArrayList<>(Arrays.asList(0,0)), 1));
23
+ }
24
+
25
+ }
find_the_largest_almost_missing_integer/meta.json ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3705,
3
+ "name": "find_the_largest_almost_missing_integer",
4
+ "difficulty": "Easy",
5
+ "link": "https://leetcode.com/problems/find-the-largest-almost-missing-integer/",
6
+ "date": "2025-02-23 00:00:00",
7
+ "task_description": "You are given an integer array `nums` and an integer `k`. An integer `x` is **almost missing** from `nums` if `x` appears in _exactly_ one subarray of size `k` within `nums`. Return the largest **almost missing** integer from `nums`. If no such integer exists, return `-1`. A **subarray** is a contiguous sequence of elements within an array. **Example 1:** **Input:** nums = [3,9,2,1,7], k = 3 **Output:** 7 **Explanation:** 1 appears in 2 subarrays of size 3: `[9, 2, 1]` and `[2, 1, 7]`. 2 appears in 3 subarrays of size 3: `[3, 9, 2]`, `[9, 2, 1]`, `[2, 1, 7]`. 3 appears in 1 subarray of size 3: `[3, 9, 2]`. 7 appears in 1 subarray of size 3: `[2, 1, 7]`. 9 appears in 2 subarrays of size 3: `[3, 9, 2]`, and `[9, 2, 1]`. We return 7 since it is the largest integer that appears in exactly one subarray of size `k`. **Example 2:** **Input:** nums = [3,9,7,2,1,7], k = 4 **Output:** 3 **Explanation:** 1 appears in 2 subarrays of size 4: `[9, 7, 2, 1]`, `[7, 2, 1, 7]`. 2 appears in 3 subarrays of size 4: `[3, 9, 7, 2]`, `[9, 7, 2, 1]`, `[7, 2, 1, 7]`. 3 appears in 1 subarray of size 4: `[3, 9, 7, 2]`. 7 appears in 3 subarrays of size 4: `[3, 9, 7, 2]`, `[9, 7, 2, 1]`, `[7, 2, 1, 7]`. 9 appears in 2 subarrays of size 4: `[3, 9, 7, 2]`, `[9, 7, 2, 1]`. We return 3 since it is the largest and only integer that appears in exactly one subarray of size `k`. **Example 3:** **Input:** nums = [0,0], k = 1 **Output:** -1 **Explanation:** There is no integer that appears in only one subarray of size 1. **Constraints:** `1 <= nums.length <= 50` `0 <= nums[i] <= 50` `1 <= k <= nums.length`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "nums = [3,9,2,1,7], k = 3",
12
+ "output": "7 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "nums = [3,9,7,2,1,7], k = 4",
17
+ "output": "3 "
18
+ },
19
+ {
20
+ "label": "Example 3",
21
+ "input": "nums = [0,0], k = 1",
22
+ "output": "-1 "
23
+ }
24
+ ],
25
+ "private_test_cases": [
26
+ {
27
+ "input": [
28
+ [
29
+ 6,
30
+ 8,
31
+ 14,
32
+ 7,
33
+ 24,
34
+ 43,
35
+ 43,
36
+ 48,
37
+ 16,
38
+ 30,
39
+ 10,
40
+ 36,
41
+ 34,
42
+ 2,
43
+ 9,
44
+ 19,
45
+ 2,
46
+ 37,
47
+ 36
48
+ ],
49
+ 3
50
+ ],
51
+ "output": 6
52
+ },
53
+ {
54
+ "input": [
55
+ [
56
+ 30,
57
+ 49,
58
+ 42,
59
+ 15,
60
+ 48,
61
+ 19,
62
+ 21,
63
+ 31,
64
+ 1,
65
+ 3,
66
+ 15,
67
+ 38,
68
+ 17,
69
+ 46,
70
+ 23,
71
+ 42,
72
+ 37,
73
+ 28,
74
+ 14,
75
+ 14,
76
+ 5,
77
+ 0,
78
+ 15,
79
+ 30,
80
+ 6,
81
+ 21,
82
+ 19,
83
+ 15,
84
+ 37
85
+ ],
86
+ 19
87
+ ],
88
+ "output": -1
89
+ },
90
+ {
91
+ "input": [
92
+ [
93
+ 33,
94
+ 25,
95
+ 46,
96
+ 21,
97
+ 30,
98
+ 32,
99
+ 49,
100
+ 24,
101
+ 9,
102
+ 13,
103
+ 16,
104
+ 6,
105
+ 16,
106
+ 22,
107
+ 30,
108
+ 48,
109
+ 13,
110
+ 31,
111
+ 13,
112
+ 34,
113
+ 26,
114
+ 1,
115
+ 45,
116
+ 45,
117
+ 22,
118
+ 11,
119
+ 38,
120
+ 10,
121
+ 38,
122
+ 12,
123
+ 15,
124
+ 27,
125
+ 10
126
+ ],
127
+ 26
128
+ ],
129
+ "output": 33
130
+ },
131
+ {
132
+ "input": [
133
+ [
134
+ 18,
135
+ 49,
136
+ 2,
137
+ 10,
138
+ 38,
139
+ 21,
140
+ 5,
141
+ 24,
142
+ 30,
143
+ 50,
144
+ 22,
145
+ 37,
146
+ 28,
147
+ 15,
148
+ 40,
149
+ 19,
150
+ 2,
151
+ 5,
152
+ 50,
153
+ 18,
154
+ 21,
155
+ 26,
156
+ 12,
157
+ 12,
158
+ 38,
159
+ 7,
160
+ 39,
161
+ 12,
162
+ 34
163
+ ],
164
+ 20
165
+ ],
166
+ "output": 34
167
+ },
168
+ {
169
+ "input": [
170
+ [
171
+ 32,
172
+ 47,
173
+ 9,
174
+ 39,
175
+ 19,
176
+ 40,
177
+ 16,
178
+ 10,
179
+ 21,
180
+ 11,
181
+ 40,
182
+ 32,
183
+ 33,
184
+ 7,
185
+ 47,
186
+ 12,
187
+ 37,
188
+ 29,
189
+ 42,
190
+ 37,
191
+ 6,
192
+ 40,
193
+ 30,
194
+ 31,
195
+ 47,
196
+ 24,
197
+ 11,
198
+ 16,
199
+ 39,
200
+ 5,
201
+ 23,
202
+ 44,
203
+ 48,
204
+ 31,
205
+ 37,
206
+ 13,
207
+ 33,
208
+ 8,
209
+ 6,
210
+ 32,
211
+ 49,
212
+ 48,
213
+ 25,
214
+ 9,
215
+ 29,
216
+ 45,
217
+ 22,
218
+ 19,
219
+ 28,
220
+ 44
221
+ ],
222
+ 21
223
+ ],
224
+ "output": -1
225
+ },
226
+ {
227
+ "input": [
228
+ [
229
+ 4,
230
+ 22,
231
+ 26,
232
+ 40,
233
+ 22,
234
+ 1,
235
+ 27,
236
+ 42,
237
+ 11,
238
+ 19,
239
+ 40,
240
+ 23
241
+ ],
242
+ 4
243
+ ],
244
+ "output": 23
245
+ },
246
+ {
247
+ "input": [
248
+ [
249
+ 43
250
+ ],
251
+ 1
252
+ ],
253
+ "output": 43
254
+ },
255
+ {
256
+ "input": [
257
+ [
258
+ 48,
259
+ 19,
260
+ 27,
261
+ 4,
262
+ 8,
263
+ 10,
264
+ 44,
265
+ 31,
266
+ 47,
267
+ 8,
268
+ 14,
269
+ 0,
270
+ 33,
271
+ 11,
272
+ 46,
273
+ 16,
274
+ 13,
275
+ 5,
276
+ 0,
277
+ 16,
278
+ 19,
279
+ 19,
280
+ 13,
281
+ 21
282
+ ],
283
+ 7
284
+ ],
285
+ "output": 48
286
+ },
287
+ {
288
+ "input": [
289
+ [
290
+ 9,
291
+ 2,
292
+ 9,
293
+ 17,
294
+ 6,
295
+ 46,
296
+ 7,
297
+ 37,
298
+ 25,
299
+ 1,
300
+ 48,
301
+ 17,
302
+ 43,
303
+ 37,
304
+ 0,
305
+ 46,
306
+ 27,
307
+ 40,
308
+ 17,
309
+ 44,
310
+ 38,
311
+ 13,
312
+ 29,
313
+ 35,
314
+ 12,
315
+ 39,
316
+ 12,
317
+ 7,
318
+ 48,
319
+ 23,
320
+ 40,
321
+ 44,
322
+ 6,
323
+ 12
324
+ ],
325
+ 23
326
+ ],
327
+ "output": -1
328
+ },
329
+ {
330
+ "input": [
331
+ [
332
+ 50,
333
+ 44,
334
+ 13,
335
+ 26,
336
+ 25,
337
+ 11,
338
+ 23,
339
+ 44,
340
+ 0,
341
+ 45,
342
+ 1,
343
+ 38,
344
+ 9,
345
+ 11,
346
+ 17
347
+ ],
348
+ 10
349
+ ],
350
+ "output": 50
351
+ }
352
+ ],
353
+ "haskell_template": "largestInteger :: [Int] -> Int -> Int\nlargestInteger nums k ",
354
+ "ocaml_template": "let largestInteger (nums: int list) (k: int) : int = ",
355
+ "scala_template": "def largestInteger(nums: List[Int],k: Int): Int = { \n \n}",
356
+ "java_template": "class Solution {\n public int largestInteger(int[] nums, int k) {\n \n }\n}",
357
+ "python_template": "class Solution(object):\n def largestInteger(self, nums, k):\n \"\"\"\n :type nums: List[int]\n :type k: int\n :rtype: int\n \"\"\"\n "
358
+ }
find_the_largest_almost_missing_integer/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 7 (largestInteger [3;9;2;1;7] 3)
12
+
13
+ let test2 _ = assert_equal 3 (largestInteger [3;9;7;2;1;7] 4)
14
+
15
+ let test3 _ = assert_equal (-1) (largestInteger [0;0] 1)
16
+
17
+ let test4 _ = assert_equal 6 (largestInteger [6; 8; 14; 7; 24; 43; 43; 48; 16; 30; 10; 36; 34; 2; 9; 19; 2; 37; 36] 3)
18
+
19
+ let test5 _ = assert_equal (-1) (largestInteger [30; 49; 42; 15; 48; 19; 21; 31; 1; 3; 15; 38; 17; 46; 23; 42; 37; 28; 14; 14; 5; 0; 15; 30; 6; 21; 19; 15; 37] 19)
20
+
21
+ let test6 _ = assert_equal 33 (largestInteger [33; 25; 46; 21; 30; 32; 49; 24; 9; 13; 16; 6; 16; 22; 30; 48; 13; 31; 13; 34; 26; 1; 45; 45; 22; 11; 38; 10; 38; 12; 15; 27; 10] 26)
22
+
23
+ let test7 _ = assert_equal 34 (largestInteger [18; 49; 2; 10; 38; 21; 5; 24; 30; 50; 22; 37; 28; 15; 40; 19; 2; 5; 50; 18; 21; 26; 12; 12; 38; 7; 39; 12; 34] 20)
24
+
25
+ let test8 _ = assert_equal (-1) (largestInteger [32; 47; 9; 39; 19; 40; 16; 10; 21; 11; 40; 32; 33; 7; 47; 12; 37; 29; 42; 37; 6; 40; 30; 31; 47; 24; 11; 16; 39; 5; 23; 44; 48; 31; 37; 13; 33; 8; 6; 32; 49; 48; 25; 9; 29; 45; 22; 19; 28; 44] 21)
26
+
27
+ let test9 _ = assert_equal 23 (largestInteger [4; 22; 26; 40; 22; 1; 27; 42; 11; 19; 40; 23] 4)
28
+
29
+ let test10 _ = assert_equal 43 (largestInteger [43] 1)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for largestInteger" >::: [
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
find_the_largest_almost_missing_integer/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.largestInteger(List(3,9,2,1,7),3), 7)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.largestInteger(List(3,9,7,2,1,7),4), 3)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.largestInteger(List(0,0),1), -1)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.largestInteger(List(6, 8, 14, 7, 24, 43, 43, 48, 16, 30, 10, 36, 34, 2, 9, 19, 2, 37, 36),3), 6)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.largestInteger(List(30, 49, 42, 15, 48, 19, 21, 31, 1, 3, 15, 38, 17, 46, 23, 42, 37, 28, 14, 14, 5, 0, 15, 30, 6, 21, 19, 15, 37),19), -1)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.largestInteger(List(33, 25, 46, 21, 30, 32, 49, 24, 9, 13, 16, 6, 16, 22, 30, 48, 13, 31, 13, 34, 26, 1, 45, 45, 22, 11, 38, 10, 38, 12, 15, 27, 10),26), 33)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.largestInteger(List(18, 49, 2, 10, 38, 21, 5, 24, 30, 50, 22, 37, 28, 15, 40, 19, 2, 5, 50, 18, 21, 26, 12, 12, 38, 7, 39, 12, 34),20), 34)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.largestInteger(List(32, 47, 9, 39, 19, 40, 16, 10, 21, 11, 40, 32, 33, 7, 47, 12, 37, 29, 42, 37, 6, 40, 30, 31, 47, 24, 11, 16, 39, 5, 23, 44, 48, 31, 37, 13, 33, 8, 6, 32, 49, 48, 25, 9, 29, 45, 22, 19, 28, 44),21), -1)
34
+ }
35
+
36
+ test("test9") {
37
+ assertEquals(Main.largestInteger(List(4, 22, 26, 40, 22, 1, 27, 42, 11, 19, 40, 23),4), 23)
38
+ }
39
+
40
+ test("test10") {
41
+ assertEquals(Main.largestInteger(List(43),1), 43)
42
+ }
43
+
44
+ }
find_the_largest_area_of_square_inside_two_rectangles/haskell_tests/Main.hs ADDED
The diff for this file is too large to render. See raw diff
 
find_the_largest_area_of_square_inside_two_rectangles/java_tests/Main.java ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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(1, largestSquareArea(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,1)),new ArrayList<>(Arrays.asList(2,2)),new ArrayList<>(Arrays.asList(3,1)))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(3,3)),new ArrayList<>(Arrays.asList(4,4)),new ArrayList<>(Arrays.asList(6,6))))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(4, largestSquareArea(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,1)),new ArrayList<>(Arrays.asList(1,3)),new ArrayList<>(Arrays.asList(1,5)))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(5,5)),new ArrayList<>(Arrays.asList(5,7)),new ArrayList<>(Arrays.asList(5,9))))));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals(1, largestSquareArea(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,1)),new ArrayList<>(Arrays.asList(2,2)),new ArrayList<>(Arrays.asList(1,2)))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(3,3)),new ArrayList<>(Arrays.asList(4,4)),new ArrayList<>(Arrays.asList(3,4))))));
23
+ }
24
+ @Test
25
+ public void test4() {
26
+ assertEquals(0, largestSquareArea(new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(1,1)),new ArrayList<>(Arrays.asList(3,3)),new ArrayList<>(Arrays.asList(3,1)))), new ArrayList<>(Arrays.asList(new ArrayList<>(Arrays.asList(2,2)),new ArrayList<>(Arrays.asList(4,4)),new ArrayList<>(Arrays.asList(4,2))))));
27
+ }
28
+
29
+ }
find_the_largest_area_of_square_inside_two_rectangles/meta.json ADDED
The diff for this file is too large to render. See raw diff
 
find_the_largest_area_of_square_inside_two_rectangles/ocaml_tests/main.ml ADDED
The diff for this file is too large to render. See raw diff
 
find_the_largest_area_of_square_inside_two_rectangles/scala_tests/MySuite.scala ADDED
The diff for this file is too large to render. See raw diff
 
find_the_largest_palindrome_divisible_by_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("5", largestPalindrome(3, 5));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("4", largestPalindrome(1, 4));
19
+ }
20
+ @Test
21
+ public void test3() {
22
+ assertEquals("6", largestPalindrome(5, 6));
23
+ }
24
+
25
+ }
find_the_length_of_the_longest_common_prefix/haskell_tests/Main.hs ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 (longestCommonPrefix [1,10,100] [1000])," 3 (longestCommonPrefix [1,10,100] [1000]))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (longestCommonPrefix [1,2,3] [4,4,4])," 0 (longestCommonPrefix [1,2,3] [4,4,4]))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (longestCommonPrefix [1685124, 31971415, 30996052, 70843378, 80343404, 58267581, 47847183, 92655193, 40887814, 82705217, 31120515, 7344808, 85691467, 66483405, 10612551, 28813428, 66113870] [48328197, 85963335, 78418410, 2560379, 86988766, 25871217, 66109985, 68252350, 75124872, 73548714, 63016225, 1160150, 93226011, 32185166, 82274311, 48267144, 56268706, 31792257, 96323763, 87113832, 78056691, 62595475, 41784371, 79947444])," 3 (longestCommonPrefix [1685124, 31971415, 30996052, 70843378, 80343404, 58267581, 47847183, 92655193, 40887814, 82705217, 31120515, 7344808, 85691467, 66483405, 10612551, 28813428, 66113870] [48328197, 85963335, 78418410, 2560379, 86988766, 25871217, 66109985, 68252350, 75124872, 73548714, 63016225, 1160150, 93226011, 32185166, 82274311, 48267144, 56268706, 31792257, 96323763, 87113832, 78056691, 62595475, 41784371, 79947444]))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (longestCommonPrefix [76518673, 4871475, 60690400, 86638636, 41983842, 73715036, 36854358, 53917882, 73771841, 66665209, 62519315, 49972298, 42276292, 87130456, 59785132, 39149629, 91353389] [91699048, 61064397, 62350879, 5050815, 96664085, 84268887, 8955990])," 2 (longestCommonPrefix [76518673, 4871475, 60690400, 86638636, 41983842, 73715036, 36854358, 53917882, 73771841, 66665209, 62519315, 49972298, 42276292, 87130456, 59785132, 39149629, 91353389] [91699048, 61064397, 62350879, 5050815, 96664085, 84268887, 8955990]))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (longestCommonPrefix [60407080, 79127639, 49432300, 43332023, 53539555, 91634408, 18311717, 28798951, 22060558, 6362633, 63274988, 10448299, 75360695, 46347618, 77893728, 19967784, 99599148, 65723440, 16323307, 7521632] [22879737, 56304474, 32098877, 40130126, 61504785, 30589899, 46315115, 24360840, 51110296, 98210043, 29533109, 5049418, 1642612, 59584965, 6483371, 47262619, 63477407, 37708802, 28177066, 50293135])," 3 (longestCommonPrefix [60407080, 79127639, 49432300, 43332023, 53539555, 91634408, 18311717, 28798951, 22060558, 6362633, 63274988, 10448299, 75360695, 46347618, 77893728, 19967784, 99599148, 65723440, 16323307, 7521632] [22879737, 56304474, 32098877, 40130126, 61504785, 30589899, 46315115, 24360840, 51110296, 98210043, 29533109, 5049418, 1642612, 59584965, 6483371, 47262619, 63477407, 37708802, 28177066, 50293135]))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (longestCommonPrefix [1935311, 90770975, 51888515, 57755600, 52191609, 61737305, 55348661, 10152067, 3532963, 40594756, 79250118, 70590455, 97204216] [98442519, 48117894, 28853806, 79075598, 17205148, 58060053, 55613877, 20846317, 26951360, 83027499, 64184225, 37086277, 2179321, 43072513, 88831325, 97851729, 80942925, 56952289, 61242246, 79693558, 78372685, 31638154, 86152886, 12811502, 82995141, 31215174, 27498200, 341659])," 2 (longestCommonPrefix [1935311, 90770975, 51888515, 57755600, 52191609, 61737305, 55348661, 10152067, 3532963, 40594756, 79250118, 70590455, 97204216] [98442519, 48117894, 28853806, 79075598, 17205148, 58060053, 55613877, 20846317, 26951360, 83027499, 64184225, 37086277, 2179321, 43072513, 88831325, 97851729, 80942925, 56952289, 61242246, 79693558, 78372685, 31638154, 86152886, 12811502, 82995141, 31215174, 27498200, 341659]))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (longestCommonPrefix [11895329, 12096252, 48658982, 23351572, 16597574, 57126015, 75403608, 71662427, 7377937, 53659563] [6291992, 48076920, 53623793, 79731267, 3978291, 13504846, 66497777, 1191566, 76781239, 99224769, 56294681, 61688586, 87645075, 22777021, 60183744, 84067369, 49666942, 57606021, 6814094, 9612959, 43424291, 32213744, 65324403, 84929635, 49208547, 38955445, 80791713, 17338815, 39301087, 86314822, 31768660, 56742113, 16079953, 4925264])," 3 (longestCommonPrefix [11895329, 12096252, 48658982, 23351572, 16597574, 57126015, 75403608, 71662427, 7377937, 53659563] [6291992, 48076920, 53623793, 79731267, 3978291, 13504846, 66497777, 1191566, 76781239, 99224769, 56294681, 61688586, 87645075, 22777021, 60183744, 84067369, 49666942, 57606021, 6814094, 9612959, 43424291, 32213744, 65324403, 84929635, 49208547, 38955445, 80791713, 17338815, 39301087, 86314822, 31768660, 56742113, 16079953, 4925264]))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (longestCommonPrefix [11457746, 29939969, 85409788, 65765695, 68655509, 40081079, 88779112, 76268979, 53835560, 29630025, 43150804, 60307863, 88906955, 12204904, 56859573, 19623528, 75462358, 50137473, 81222708, 97981948, 8226963, 1404194, 4946268, 19588973, 29313307, 18372143, 78602770, 29309356, 60359563, 79086587, 42320061, 73257764, 47121220, 11106682, 67470036, 28271290, 21023432, 66986964, 21104404, 80931969, 92896967, 89939816, 92059993, 49119418, 19323903, 9375357] [2588356, 43412820, 68506296, 93870538, 52152364, 94613873, 76921973, 146864, 21912692, 12984474, 39202994, 10548977, 30115843, 48207176, 53706569, 20082648, 55856670, 33635079, 7056205, 29162615, 3915807])," 2 (longestCommonPrefix [11457746, 29939969, 85409788, 65765695, 68655509, 40081079, 88779112, 76268979, 53835560, 29630025, 43150804, 60307863, 88906955, 12204904, 56859573, 19623528, 75462358, 50137473, 81222708, 97981948, 8226963, 1404194, 4946268, 19588973, 29313307, 18372143, 78602770, 29309356, 60359563, 79086587, 42320061, 73257764, 47121220, 11106682, 67470036, 28271290, 21023432, 66986964, 21104404, 80931969, 92896967, 89939816, 92059993, 49119418, 19323903, 9375357] [2588356, 43412820, 68506296, 93870538, 52152364, 94613873, 76921973, 146864, 21912692, 12984474, 39202994, 10548977, 30115843, 48207176, 53706569, 20082648, 55856670, 33635079, 7056205, 29162615, 3915807]))
34
+
35
+
36
+ -- Grouping test cases
37
+ tests :: Test
38
+ tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6, TestLabel "Test7" test7]
39
+
40
+ -- Running the tests
41
+ main :: IO Counts
42
+ main = runTestTT tests
find_the_length_of_the_longest_common_prefix/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, longestCommonPrefix(new ArrayList<>(Arrays.asList(1,10,100)), new ArrayList<>(Arrays.asList(1000))));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals(0, longestCommonPrefix(new ArrayList<>(Arrays.asList(1,2,3)), new ArrayList<>(Arrays.asList(4,4,4))));
19
+ }
20
+
21
+ }
find_the_length_of_the_longest_common_prefix/meta.json ADDED
@@ -0,0 +1,338 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3329,
3
+ "name": "find_the_length_of_the_longest_common_prefix",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/find-the-length-of-the-longest-common-prefix/",
6
+ "date": "2024-02-11 00:00:00",
7
+ "task_description": "You are given two arrays with **positive** integers `arr1` and `arr2`. A **prefix** of a positive integer is an integer formed by one or more of its digits, starting from its **leftmost** digit. For example, `123` is a prefix of the integer `12345`, while `234` is **not**. A **common prefix** of two integers `a` and `b` is an integer `c`, such that `c` is a prefix of both `a` and `b`. For example, `5655359` and `56554` have common prefixes `565` and `5655` while `1223` and `43456` **do not** have a common prefix. You need to find the length of the **longest common prefix** between all pairs of integers `(x, y)` such that `x` belongs to `arr1` and `y` belongs to `arr2`. Return _the length of the **longest** common prefix among all pairs_._ If no common prefix exists among them_, _return_ `0`. **Example 1:** ``` **Input:** arr1 = [1,10,100], arr2 = [1000] **Output:** 3 **Explanation:** There are 3 pairs (arr1[i], arr2[j]): - The longest common prefix of (1, 1000) is 1. - The longest common prefix of (10, 1000) is 10. - The longest common prefix of (100, 1000) is 100. The longest common prefix is 100 with a length of 3. ``` **Example 2:** ``` **Input:** arr1 = [1,2,3], arr2 = [4,4,4] **Output:** 0 **Explanation:** There exists no common prefix for any pair (arr1[i], arr2[j]), hence we return 0. Note that common prefixes between elements of the same array do not count. ``` **Constraints:** `1 <= arr1.length, arr2.length <= 5 * 104` `1 <= arr1[i], arr2[i] <= 108`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "arr1 = [1,10,100], arr2 = [1000]",
12
+ "output": "3 "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "arr1 = [1,2,3], arr2 = [4,4,4]",
17
+ "output": "0 "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ [
24
+ 1685124,
25
+ 31971415,
26
+ 30996052,
27
+ 70843378,
28
+ 80343404,
29
+ 58267581,
30
+ 47847183,
31
+ 92655193,
32
+ 40887814,
33
+ 82705217,
34
+ 31120515,
35
+ 7344808,
36
+ 85691467,
37
+ 66483405,
38
+ 10612551,
39
+ 28813428,
40
+ 66113870
41
+ ],
42
+ [
43
+ 48328197,
44
+ 85963335,
45
+ 78418410,
46
+ 2560379,
47
+ 86988766,
48
+ 25871217,
49
+ 66109985,
50
+ 68252350,
51
+ 75124872,
52
+ 73548714,
53
+ 63016225,
54
+ 1160150,
55
+ 93226011,
56
+ 32185166,
57
+ 82274311,
58
+ 48267144,
59
+ 56268706,
60
+ 31792257,
61
+ 96323763,
62
+ 87113832,
63
+ 78056691,
64
+ 62595475,
65
+ 41784371,
66
+ 79947444
67
+ ]
68
+ ],
69
+ "output": 3
70
+ },
71
+ {
72
+ "input": [
73
+ [
74
+ 76518673,
75
+ 4871475,
76
+ 60690400,
77
+ 86638636,
78
+ 41983842,
79
+ 73715036,
80
+ 36854358,
81
+ 53917882,
82
+ 73771841,
83
+ 66665209,
84
+ 62519315,
85
+ 49972298,
86
+ 42276292,
87
+ 87130456,
88
+ 59785132,
89
+ 39149629,
90
+ 91353389
91
+ ],
92
+ [
93
+ 91699048,
94
+ 61064397,
95
+ 62350879,
96
+ 5050815,
97
+ 96664085,
98
+ 84268887,
99
+ 8955990
100
+ ]
101
+ ],
102
+ "output": 2
103
+ },
104
+ {
105
+ "input": [
106
+ [
107
+ 60407080,
108
+ 79127639,
109
+ 49432300,
110
+ 43332023,
111
+ 53539555,
112
+ 91634408,
113
+ 18311717,
114
+ 28798951,
115
+ 22060558,
116
+ 6362633,
117
+ 63274988,
118
+ 10448299,
119
+ 75360695,
120
+ 46347618,
121
+ 77893728,
122
+ 19967784,
123
+ 99599148,
124
+ 65723440,
125
+ 16323307,
126
+ 7521632
127
+ ],
128
+ [
129
+ 22879737,
130
+ 56304474,
131
+ 32098877,
132
+ 40130126,
133
+ 61504785,
134
+ 30589899,
135
+ 46315115,
136
+ 24360840,
137
+ 51110296,
138
+ 98210043,
139
+ 29533109,
140
+ 5049418,
141
+ 1642612,
142
+ 59584965,
143
+ 6483371,
144
+ 47262619,
145
+ 63477407,
146
+ 37708802,
147
+ 28177066,
148
+ 50293135
149
+ ]
150
+ ],
151
+ "output": 3
152
+ },
153
+ {
154
+ "input": [
155
+ [
156
+ 1935311,
157
+ 90770975,
158
+ 51888515,
159
+ 57755600,
160
+ 52191609,
161
+ 61737305,
162
+ 55348661,
163
+ 10152067,
164
+ 3532963,
165
+ 40594756,
166
+ 79250118,
167
+ 70590455,
168
+ 97204216
169
+ ],
170
+ [
171
+ 98442519,
172
+ 48117894,
173
+ 28853806,
174
+ 79075598,
175
+ 17205148,
176
+ 58060053,
177
+ 55613877,
178
+ 20846317,
179
+ 26951360,
180
+ 83027499,
181
+ 64184225,
182
+ 37086277,
183
+ 2179321,
184
+ 43072513,
185
+ 88831325,
186
+ 97851729,
187
+ 80942925,
188
+ 56952289,
189
+ 61242246,
190
+ 79693558,
191
+ 78372685,
192
+ 31638154,
193
+ 86152886,
194
+ 12811502,
195
+ 82995141,
196
+ 31215174,
197
+ 27498200,
198
+ 341659
199
+ ]
200
+ ],
201
+ "output": 2
202
+ },
203
+ {
204
+ "input": [
205
+ [
206
+ 11895329,
207
+ 12096252,
208
+ 48658982,
209
+ 23351572,
210
+ 16597574,
211
+ 57126015,
212
+ 75403608,
213
+ 71662427,
214
+ 7377937,
215
+ 53659563
216
+ ],
217
+ [
218
+ 6291992,
219
+ 48076920,
220
+ 53623793,
221
+ 79731267,
222
+ 3978291,
223
+ 13504846,
224
+ 66497777,
225
+ 1191566,
226
+ 76781239,
227
+ 99224769,
228
+ 56294681,
229
+ 61688586,
230
+ 87645075,
231
+ 22777021,
232
+ 60183744,
233
+ 84067369,
234
+ 49666942,
235
+ 57606021,
236
+ 6814094,
237
+ 9612959,
238
+ 43424291,
239
+ 32213744,
240
+ 65324403,
241
+ 84929635,
242
+ 49208547,
243
+ 38955445,
244
+ 80791713,
245
+ 17338815,
246
+ 39301087,
247
+ 86314822,
248
+ 31768660,
249
+ 56742113,
250
+ 16079953,
251
+ 4925264
252
+ ]
253
+ ],
254
+ "output": 3
255
+ },
256
+ {
257
+ "input": [
258
+ [
259
+ 11457746,
260
+ 29939969,
261
+ 85409788,
262
+ 65765695,
263
+ 68655509,
264
+ 40081079,
265
+ 88779112,
266
+ 76268979,
267
+ 53835560,
268
+ 29630025,
269
+ 43150804,
270
+ 60307863,
271
+ 88906955,
272
+ 12204904,
273
+ 56859573,
274
+ 19623528,
275
+ 75462358,
276
+ 50137473,
277
+ 81222708,
278
+ 97981948,
279
+ 8226963,
280
+ 1404194,
281
+ 4946268,
282
+ 19588973,
283
+ 29313307,
284
+ 18372143,
285
+ 78602770,
286
+ 29309356,
287
+ 60359563,
288
+ 79086587,
289
+ 42320061,
290
+ 73257764,
291
+ 47121220,
292
+ 11106682,
293
+ 67470036,
294
+ 28271290,
295
+ 21023432,
296
+ 66986964,
297
+ 21104404,
298
+ 80931969,
299
+ 92896967,
300
+ 89939816,
301
+ 92059993,
302
+ 49119418,
303
+ 19323903,
304
+ 9375357
305
+ ],
306
+ [
307
+ 2588356,
308
+ 43412820,
309
+ 68506296,
310
+ 93870538,
311
+ 52152364,
312
+ 94613873,
313
+ 76921973,
314
+ 146864,
315
+ 21912692,
316
+ 12984474,
317
+ 39202994,
318
+ 10548977,
319
+ 30115843,
320
+ 48207176,
321
+ 53706569,
322
+ 20082648,
323
+ 55856670,
324
+ 33635079,
325
+ 7056205,
326
+ 29162615,
327
+ 3915807
328
+ ]
329
+ ],
330
+ "output": 2
331
+ }
332
+ ],
333
+ "haskell_template": "longestCommonPrefix :: [Int] -> [Int] -> Int\nlongestCommonPrefix arr1 arr2 ",
334
+ "ocaml_template": "let longestCommonPrefix (arr1: int list) (arr2: int list) : int = ",
335
+ "scala_template": "def longestCommonPrefix(arr1: List[Int],arr2: List[Int]): Int = { \n \n}",
336
+ "java_template": "class Solution {\n public int longestCommonPrefix(int[] arr1, int[] arr2) {\n \n }\n}",
337
+ "python_template": "class Solution(object):\n def longestCommonPrefix(self, arr1, arr2):\n \"\"\"\n :type arr1: List[int]\n :type arr2: List[int]\n :rtype: int\n \"\"\"\n "
338
+ }
find_the_length_of_the_longest_common_prefix/ocaml_tests/main.ml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 (longestCommonPrefix [1;10;100] [1000])
12
+
13
+ let test2 _ = assert_equal 0 (longestCommonPrefix [1;2;3] [4;4;4])
14
+
15
+ let test3 _ = assert_equal 3 (longestCommonPrefix [1685124; 31971415; 30996052; 70843378; 80343404; 58267581; 47847183; 92655193; 40887814; 82705217; 31120515; 7344808; 85691467; 66483405; 10612551; 28813428; 66113870] [48328197; 85963335; 78418410; 2560379; 86988766; 25871217; 66109985; 68252350; 75124872; 73548714; 63016225; 1160150; 93226011; 32185166; 82274311; 48267144; 56268706; 31792257; 96323763; 87113832; 78056691; 62595475; 41784371; 79947444])
16
+
17
+ let test4 _ = assert_equal 2 (longestCommonPrefix [76518673; 4871475; 60690400; 86638636; 41983842; 73715036; 36854358; 53917882; 73771841; 66665209; 62519315; 49972298; 42276292; 87130456; 59785132; 39149629; 91353389] [91699048; 61064397; 62350879; 5050815; 96664085; 84268887; 8955990])
18
+
19
+ let test5 _ = assert_equal 3 (longestCommonPrefix [60407080; 79127639; 49432300; 43332023; 53539555; 91634408; 18311717; 28798951; 22060558; 6362633; 63274988; 10448299; 75360695; 46347618; 77893728; 19967784; 99599148; 65723440; 16323307; 7521632] [22879737; 56304474; 32098877; 40130126; 61504785; 30589899; 46315115; 24360840; 51110296; 98210043; 29533109; 5049418; 1642612; 59584965; 6483371; 47262619; 63477407; 37708802; 28177066; 50293135])
20
+
21
+ let test6 _ = assert_equal 2 (longestCommonPrefix [1935311; 90770975; 51888515; 57755600; 52191609; 61737305; 55348661; 10152067; 3532963; 40594756; 79250118; 70590455; 97204216] [98442519; 48117894; 28853806; 79075598; 17205148; 58060053; 55613877; 20846317; 26951360; 83027499; 64184225; 37086277; 2179321; 43072513; 88831325; 97851729; 80942925; 56952289; 61242246; 79693558; 78372685; 31638154; 86152886; 12811502; 82995141; 31215174; 27498200; 341659])
22
+
23
+ let test7 _ = assert_equal 3 (longestCommonPrefix [11895329; 12096252; 48658982; 23351572; 16597574; 57126015; 75403608; 71662427; 7377937; 53659563] [6291992; 48076920; 53623793; 79731267; 3978291; 13504846; 66497777; 1191566; 76781239; 99224769; 56294681; 61688586; 87645075; 22777021; 60183744; 84067369; 49666942; 57606021; 6814094; 9612959; 43424291; 32213744; 65324403; 84929635; 49208547; 38955445; 80791713; 17338815; 39301087; 86314822; 31768660; 56742113; 16079953; 4925264])
24
+
25
+ let test8 _ = assert_equal 2 (longestCommonPrefix [11457746; 29939969; 85409788; 65765695; 68655509; 40081079; 88779112; 76268979; 53835560; 29630025; 43150804; 60307863; 88906955; 12204904; 56859573; 19623528; 75462358; 50137473; 81222708; 97981948; 8226963; 1404194; 4946268; 19588973; 29313307; 18372143; 78602770; 29309356; 60359563; 79086587; 42320061; 73257764; 47121220; 11106682; 67470036; 28271290; 21023432; 66986964; 21104404; 80931969; 92896967; 89939816; 92059993; 49119418; 19323903; 9375357] [2588356; 43412820; 68506296; 93870538; 52152364; 94613873; 76921973; 146864; 21912692; 12984474; 39202994; 10548977; 30115843; 48207176; 53706569; 20082648; 55856670; 33635079; 7056205; 29162615; 3915807])
26
+
27
+
28
+ (* Grouping test cases *)
29
+ let suite = "Test Suite for longestCommonPrefix" >::: [
30
+
31
+ "test1" >:: test1;
32
+ "test2" >:: test2;
33
+ "test3" >:: test3;
34
+ "test4" >:: test4;
35
+ "test5" >:: test5;
36
+ "test6" >:: test6;
37
+ "test7" >:: test7;
38
+ "test8" >:: test8;
39
+ ]
40
+
41
+
42
+ (* Running the tests *)
43
+ let () = run_test_tt_main suite
44
+ end
find_the_length_of_the_longest_common_prefix/scala_tests/MySuite.scala ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ class MySuite extends munit.FunSuite {
3
+
4
+ test("test1") {
5
+ assertEquals(Main.longestCommonPrefix(List(1,10,100),List(1000)), 3)
6
+ }
7
+
8
+ test("test2") {
9
+ assertEquals(Main.longestCommonPrefix(List(1,2,3),List(4,4,4)), 0)
10
+ }
11
+
12
+ test("test3") {
13
+ assertEquals(Main.longestCommonPrefix(List(1685124, 31971415, 30996052, 70843378, 80343404, 58267581, 47847183, 92655193, 40887814, 82705217, 31120515, 7344808, 85691467, 66483405, 10612551, 28813428, 66113870),List(48328197, 85963335, 78418410, 2560379, 86988766, 25871217, 66109985, 68252350, 75124872, 73548714, 63016225, 1160150, 93226011, 32185166, 82274311, 48267144, 56268706, 31792257, 96323763, 87113832, 78056691, 62595475, 41784371, 79947444)), 3)
14
+ }
15
+
16
+ test("test4") {
17
+ assertEquals(Main.longestCommonPrefix(List(76518673, 4871475, 60690400, 86638636, 41983842, 73715036, 36854358, 53917882, 73771841, 66665209, 62519315, 49972298, 42276292, 87130456, 59785132, 39149629, 91353389),List(91699048, 61064397, 62350879, 5050815, 96664085, 84268887, 8955990)), 2)
18
+ }
19
+
20
+ test("test5") {
21
+ assertEquals(Main.longestCommonPrefix(List(60407080, 79127639, 49432300, 43332023, 53539555, 91634408, 18311717, 28798951, 22060558, 6362633, 63274988, 10448299, 75360695, 46347618, 77893728, 19967784, 99599148, 65723440, 16323307, 7521632),List(22879737, 56304474, 32098877, 40130126, 61504785, 30589899, 46315115, 24360840, 51110296, 98210043, 29533109, 5049418, 1642612, 59584965, 6483371, 47262619, 63477407, 37708802, 28177066, 50293135)), 3)
22
+ }
23
+
24
+ test("test6") {
25
+ assertEquals(Main.longestCommonPrefix(List(1935311, 90770975, 51888515, 57755600, 52191609, 61737305, 55348661, 10152067, 3532963, 40594756, 79250118, 70590455, 97204216),List(98442519, 48117894, 28853806, 79075598, 17205148, 58060053, 55613877, 20846317, 26951360, 83027499, 64184225, 37086277, 2179321, 43072513, 88831325, 97851729, 80942925, 56952289, 61242246, 79693558, 78372685, 31638154, 86152886, 12811502, 82995141, 31215174, 27498200, 341659)), 2)
26
+ }
27
+
28
+ test("test7") {
29
+ assertEquals(Main.longestCommonPrefix(List(11895329, 12096252, 48658982, 23351572, 16597574, 57126015, 75403608, 71662427, 7377937, 53659563),List(6291992, 48076920, 53623793, 79731267, 3978291, 13504846, 66497777, 1191566, 76781239, 99224769, 56294681, 61688586, 87645075, 22777021, 60183744, 84067369, 49666942, 57606021, 6814094, 9612959, 43424291, 32213744, 65324403, 84929635, 49208547, 38955445, 80791713, 17338815, 39301087, 86314822, 31768660, 56742113, 16079953, 4925264)), 3)
30
+ }
31
+
32
+ test("test8") {
33
+ assertEquals(Main.longestCommonPrefix(List(11457746, 29939969, 85409788, 65765695, 68655509, 40081079, 88779112, 76268979, 53835560, 29630025, 43150804, 60307863, 88906955, 12204904, 56859573, 19623528, 75462358, 50137473, 81222708, 97981948, 8226963, 1404194, 4946268, 19588973, 29313307, 18372143, 78602770, 29309356, 60359563, 79086587, 42320061, 73257764, 47121220, 11106682, 67470036, 28271290, 21023432, 66986964, 21104404, 80931969, 92896967, 89939816, 92059993, 49119418, 19323903, 9375357),List(2588356, 43412820, 68506296, 93870538, 52152364, 94613873, 76921973, 146864, 21912692, 12984474, 39202994, 10548977, 30115843, 48207176, 53706569, 20082648, 55856670, 33635079, 7056205, 29162615, 3915807)), 2)
34
+ }
35
+
36
+ }
find_the_lexicographically_largest_string_from_the_box_i/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 (answerString \"dbca \" 2)," "dbc" (answerString "dbca" 2))
13
+
14
+ test2 :: Test
15
+ test2 = TestCase (assertEqual "for (answerString \"gggg \" 4)," "g" (answerString "gggg" 4))
16
+
17
+ test3 :: Test
18
+ test3 = TestCase (assertEqual "for (answerString \"nqhhlulbqtgrmomikbouwfiehkonaqpvlhpracfnlctduxehargrlifowhfrqioqggkssjuymqquhqorjyocjvyvptalgrvwqraqterdyobtdkxlhnrmaawomhngeawmuwdjvcwczmgrbpqgugfsahkbclzjzulpzfyxgvqlhmqnitghcvenbxvacxljgygnzjkzslzyeqbggyfhfuammnraogkmqpmvuiizagwrauuwrkohrokrvtkbgmsxkbdflmczshzffptqzgjzftddvkqecpasfwsezqzbjazuyasdufqxafnwghcppsuzijzrqyhvwbxvqhalyabhodsqaadoubldztoqwokqfaoxnrhfmvkkshnxcykvugskahzqrkzumkvjxtuxyatdmblsrgtafxsbtrxafodnfdshlytekwcgpxnstrpzgicbooaqinrhonhxcrimkupurqpscdijmzxjplexfhdxjtsyvfsnbjclplrnxzdbzglapdodclqrspojvltafjsrkuqjurgnpolkukiatdhfdghqidwqyeofggxxqvjewqupzasmfcqytpqotbeotopoffeucbcytmuisvfbnkycsrnzeflzkeosygbnbaaotgzklfeieypjdjtumqufihyddpzauzqcheuhebdvfounreysaodysxoyilsnjskoxbqcnhqsazjlekviremqyhpxptayfxyuirxzsoxlyzwgcpratcefwlldyvwnqrenxsyxkjuvvpdbauxveveupezardgcwbbabvblmolbwiuyryyauqqiopkimacxhxoaymrclqunuzrnwepbfarndrqskqqvupeohtvhmmxldsovazeihyezrtcauogayqnhocuqquwolaogeigngpzkqojxjlkakwimvveczkfnuskdordqappdxpqyuneeqoargvrpfyleqtyobbxlegkbigzigqshrdimn \" 52)," "zyeqbggyfhfuammnraogkmqpmvuiizagwrauuwrkohrokrvtkbgmsxkbdflmczshzffptqzgjzftddvkqecpasfwsezqzbjazuyasdufqxafnwghcppsuzijzrqyhvwbxvqhalyabhodsqaadoubldztoqwokqfaoxnrhfmvkkshnxcykvugskahzqrkzumkvjxtuxyatdmblsrgtafxsbtrxafodnfdshlytekwcgpxnstrpzgicbooaqinrhonhxcrimkupurqpscdijmzxjplexfhdxjtsyvfsnbjclplrnxzdbzglapdodclqrspojvltafjsrkuqjurgnpolkukiatdhfdghqidwqyeofggxxqvjewqupzasmfcqytpqotbeotopoffeucbcytmuisvfbnkycsrnzeflzkeosygbnbaaotgzklfeieypjdjtumqufihyddpzauzqcheuhebdvfounreysaodysxoyilsnjskoxbqcnhqsazjlekviremqyhpxptayfxyuirxzsoxlyzwgcpratcefwlldyvwnqrenxsyxkjuvvpdbauxveveupezardgcwbbabvblmolbwiuyryyauqqiopkimacxhxoaymrclqunuzrnwepbfarndrqskqqvupeohtvhmmxldsovazeihyezrtcauogayqnhocuqquwolaogeigngpzkqojxjlkakwimvveczkfnuskdordqappdxpqyuneeqoargvrpfyleqtyobbxlegkbigzigqshrdimn" (answerString "nqhhlulbqtgrmomikbouwfiehkonaqpvlhpracfnlctduxehargrlifowhfrqioqggkssjuymqquhqorjyocjvyvptalgrvwqraqterdyobtdkxlhnrmaawomhngeawmuwdjvcwczmgrbpqgugfsahkbclzjzulpzfyxgvqlhmqnitghcvenbxvacxljgygnzjkzslzyeqbggyfhfuammnraogkmqpmvuiizagwrauuwrkohrokrvtkbgmsxkbdflmczshzffptqzgjzftddvkqecpasfwsezqzbjazuyasdufqxafnwghcppsuzijzrqyhvwbxvqhalyabhodsqaadoubldztoqwokqfaoxnrhfmvkkshnxcykvugskahzqrkzumkvjxtuxyatdmblsrgtafxsbtrxafodnfdshlytekwcgpxnstrpzgicbooaqinrhonhxcrimkupurqpscdijmzxjplexfhdxjtsyvfsnbjclplrnxzdbzglapdodclqrspojvltafjsrkuqjurgnpolkukiatdhfdghqidwqyeofggxxqvjewqupzasmfcqytpqotbeotopoffeucbcytmuisvfbnkycsrnzeflzkeosygbnbaaotgzklfeieypjdjtumqufihyddpzauzqcheuhebdvfounreysaodysxoyilsnjskoxbqcnhqsazjlekviremqyhpxptayfxyuirxzsoxlyzwgcpratcefwlldyvwnqrenxsyxkjuvvpdbauxveveupezardgcwbbabvblmolbwiuyryyauqqiopkimacxhxoaymrclqunuzrnwepbfarndrqskqqvupeohtvhmmxldsovazeihyezrtcauogayqnhocuqquwolaogeigngpzkqojxjlkakwimvveczkfnuskdordqappdxpqyuneeqoargvrpfyleqtyobbxlegkbigzigqshrdimn" 52))
19
+
20
+ test4 :: Test
21
+ test4 = TestCase (assertEqual "for (answerString \"hgovxgyedsdnatuzphaihyzfehukyziongysyddryyqnkqgnxweamkurjdzwxfvcckqqgonpfqhnsppymuymfedmktzqkitonxnonjxvqjjvydapwwmqcnzybchzhslrdqaufdipeocoxejdlpbhibbtwngseyicpebsxljpwspmlbrckmhjzngyhjbxyqaiqumjefdctxxkffylekvqzytzqawycwyaqolbygwwrhdxejoybfpunrzplcsaqyxifsxzpionszwjdzjtmacrdngbipiavnencsxbdhhkvmxqycalfewrhredtgjkdufxypnakmahmcyqfbhnrcihdtjjrmtwxcrsrxfbbommzttocudtjxrlqxrzbeixfktugubxkywbtokqvavwlpunuupfzlhzsxxcviptrwcxhywqtkrwnuibhmokdifogpnszlhhkevdtlbuaqbvylejlswgzsvujxzogfelmxstnficwvhouywcdjpeafiqcljnzywxdvbmawtykwxjkilbzanshavvnhznclharqdqeeuixhlzigbcyrkifuwkbborgwkyvhgqlmfyykdrvychvthoitenhbnxyqtdgebatkqtfiuxgujsohqfcyteifckxmybqimwxeojmdrytgbxgqdfhzgetzqeecbidrkkmzuflscsrkuvwkvqgsqrceczwvcyetjamyzvfsnafbiqseplwedwgvskgjxdneadcprrxgchvamniglwabkvepqivwiqsudwemihazoiqlhuxsmizhjzifxygmdxovzqvnsxcxtfwagsesoqvyzzdgavqvcqbibtcztkoksnycqhocikwimklkqdqqizxwixjheinxxsxgihxamcnuapazzbceekxatrtizxpvpftzhmmwbxkpdekdswckgplccfoykaqmhwdqqjemkhmcouywcvnnxsqpbzndwzcfvkrqdexhggaznucshgdrmzvsfenrjbvvkffrzbtakeaftgoenthjztvjtbrrtdazdwgerbwastrxtmqyafbxblubqgegiqiaxvdrebobpmwjrjuznbqqzqhcdtnyclxdfrwcgssecroipywqmbhltyummirpotfsexqplmubtodeumjjjorczryxeliuxtzqwnxrjulhxqzzeuqezotktycjbvndpupjprgirydnmkotydldfktccbvgtwhjqefgezyvcfnaswhalezkzrfjhtisfinesamyncimssowcpbqcfbmqtaqpyeerakffcozqybozsljdniaxbazsrehitrsvwyspdbokxusikpnjpglczaucqmtnmppkrafgwhmapocttufyljvgqmytdoysrjxtxlfgbsdnbstinqszuhtkvktubldmptuzrjjgtlnmwoubbinwfippgibfadpmyovmpoqdgepejqullsfdxsikppakbcglsazxolxatkpyjvebpgscxatazcycasirtwddqyneghvbwfuzjsoqhjibjsgrkhecjcjrpzrzjbqxghhppllgxcapvlharaatzfejgdjshyxramofbpvkknwddahrvelyobldfwmxifhzrmkqhiwhztjpowqgronuqwevlfpzitstzwmxtfvbegbasoapdjaimnjghemwnbmirjqbjtgbknwrrdjncfbaseuaymsbfiarjilzcvjyzwewvyrymxwiwgvztvrbmykapazsvrbipikvlpvgfbyfzfllairuitpqsxndpyngrfpjqvwtnwbosvasqmrgjbjxcmzshqbmtrngrymkrycwzbadxrnuamezvvkksyyekggffpdnmszasuensawjborimrzdlwewgbcfqmjdomwexvdowhgrfmwieplfmbycdfvowbopqxgblfiwufneaoggwwzrnthsjwswsgixkvfeuclbcquzptiuekvilguuocdprhjmajnsdggqoeyzqdggxqccesfepgdefpupgpdeohqaouegmiteiyprcsmqndmoytwophgyupsaifvlnrstccwqdgfibrpcausqzqhyzoclhpaywidsrzntlcwvxfykjgpmirwhxzbvntrmhhmxutwholzutoyxiumdfetacoqdwuipuebserajqcekbsvuhgufpnboefujokdyvcsyqurwqtangkmzwvobdbyzpovbekdeuowygmyfppydecqmpnjnluwwghxnxzofhkofmyszdgookxduggpuahrcpslupxkdyizrwetosjwejmscaxxglaliuhxonxchwdxvcrvkgstvsivaykkrpoktrvxkqwjxxiomgoewddiymuvwniyubzfctjemjlkwdzbyukgjoihcqvxokwlygtyruvrcolmpojkdolxditadpublhlxusscrrztsmcbbbqkmskdquadrglznprnzoggsalnirfeylqigkuxxfqbothcurtkelsyazvxlnfvvddhnpmmimaibiqfwaugmvlfibosinfyekajflsdtkgofewsnxjdplhkxzkyajhkltsrlmlowpwjncohzasinepkxsradiqbwylezzukapgxdritnxbxdktflgslkbdmgoddnoldyzyvaoqjtyrvfqidttgujhvkueempozmwrjfocnjqzbbenenyellejwqjqfjdzptgbxsrbunivfzgctnlefqasierucgmepzpnjwxeviudqmwunauqcwtizforapsqkaouhrmxoewpqpkrasnqtpbgiyzvkrieaepmodrtzoryhjtrrjbqejomlxfdsltlebvxyqpnyfgciabeyidgfdsggwaqlzucisqkzqjltscqifwbligmuioiukjddycilzqfapvhtqcddqsjndslmrpbgjsybnszmbqicjubpaqqzzjnndlkyazkagubzyxlrkxowruxlkqqgppogksmlyyxohcvpwjpujvyppolqcvolhvqddewicachmkinhnumbnagyafzieeeujuxzolrjjcmjghxpbfxanffcquwvpvmffseiatqmjgcilczzzpdxwwlggnpvykprhzmhplukwyipzuhvnzrifbfvoangtrgaeutxafgpduvdguvfxhrdoyhlpgebaycpfphsdljxgjlvkxrwlabunpzpkyeafcswjgdufdchlkjxkryzjwpquvamrxubayvncumttopnvpcojarwevhuvomxyduzbgpecwkxcyyaiuejfturwtcrndzgwjsmmwllykxjreejqdcuzhawrbwcucpvrgitqjbrdptasbhzagsazrwbzanweasgjepazztlkjdwudgjzhrllwptbgoegklazudxrzahirihfjwymxtgqtxcdwiyaxdmaaeteyqtdhnlekjfznluzctpdrturfptnphkzlajydljjjvubpxpyjgpyhmaidewxgkhwmmabnhhbgfkzhunstvmvaeqvsqehbeynfqjbscnldzhxjrvvuhpwygnictahdzpugzqnisdzbqlewzdxxltxabgludzqmkdbczmvqymwrsydhclekbekufwmnilrrrpbuuddpiqyrqrmxpxuzavcbwvrsvrzlzzkoxllmkfoaujuhmmanicxnqgbbdckudegysehqfvhqgoduyqgrwsrhselnmvtibzsecdzckczgyczspnshqehhjauppnwwrvbeyyurtsjvyhxsuadmdqkmquwmsbxxgjwqldocyyuztlgvgfwkvpovuulmtrftvhhndoreqsexhlppggzbjtppvosorlfefjixilauqnrclnloohxosukfhgzjaxeynnjdixrilbgumfbxvctcvmshovvykaunhduejdwdrzsajzbtkujjkvgbvngconqsfmnghiyzwcoesezuuuvsjwwxmzrsnhfeqtlaivypffbynxbnrwspyfcmlnljoiitjflqdwrztmxqmpcvvw \" 1291)," "zzzpdxwwlggnpvykprhzmhplukwyipzuhvnzrifbfvoangtrgaeutxafgpduvdguvfxhrdoyhlpgebaycpfphsdljxgjlvkxrwlabunpzpkyeafcswjgdufdchlkjxkryzjwpquvamrxubayvncumttopnvpcojarwevhuvomxyduzbgpecwkxcyyaiuejfturwtcrndzgwjsmmwllykxjreejqdcuzhawrbwcucpvrgitqjbrdptasbhzagsazrwbzanweasgjepazztlkjdwudgjzhrllwptbgoegklazudxrzahirihfjwymxtgqtxcdwiyaxdmaaeteyqtdhnlekjfznluzctpdrturfptnphkzlajydljjjvubpxpyjgpyhmaidewxgkhwmmabnhhbgfkzhunstvmvaeqvsqehbeynfqjbscnldzhxjrvvuhpwygnictahdzpugzqnisdzbqlewzdxxltxabgludzqmkdbczmvqymwrsydhclekbekufwmnilrrrpbuuddpiqyrqrmxpxuzavcbwvrsvrzlzzkoxllmkfoaujuhmmanicxnqgbbdckudegysehqfvhqgoduyqgrwsrhselnmvtibzsecdzckczgyczspnshqehhjauppnwwrvbeyyurtsjvyhxsuadmdqkmquwmsbxxgjwqldocyyuztlgvgfwkvpovuulmtrftvhhndoreqsexhlppggzbjtppvosorlfefjixilauqnrclnloohxosukfhgzjaxeynnjdixrilbgumfbxvctcvmshovvykaunhduejdwdrzsajzbtkujjkvgbvngconqsfmnghiyzwcoesezuuuvsjwwxmzrsnhfeqtlaivypffbynxbnrwspyfcmlnljoiitjflqdwrztmxqmpcvvw" (answerString "hgovxgyedsdnatuzphaihyzfehukyziongysyddryyqnkqgnxweamkurjdzwxfvcckqqgonpfqhnsppymuymfedmktzqkitonxnonjxvqjjvydapwwmqcnzybchzhslrdqaufdipeocoxejdlpbhibbtwngseyicpebsxljpwspmlbrckmhjzngyhjbxyqaiqumjefdctxxkffylekvqzytzqawycwyaqolbygwwrhdxejoybfpunrzplcsaqyxifsxzpionszwjdzjtmacrdngbipiavnencsxbdhhkvmxqycalfewrhredtgjkdufxypnakmahmcyqfbhnrcihdtjjrmtwxcrsrxfbbommzttocudtjxrlqxrzbeixfktugubxkywbtokqvavwlpunuupfzlhzsxxcviptrwcxhywqtkrwnuibhmokdifogpnszlhhkevdtlbuaqbvylejlswgzsvujxzogfelmxstnficwvhouywcdjpeafiqcljnzywxdvbmawtykwxjkilbzanshavvnhznclharqdqeeuixhlzigbcyrkifuwkbborgwkyvhgqlmfyykdrvychvthoitenhbnxyqtdgebatkqtfiuxgujsohqfcyteifckxmybqimwxeojmdrytgbxgqdfhzgetzqeecbidrkkmzuflscsrkuvwkvqgsqrceczwvcyetjamyzvfsnafbiqseplwedwgvskgjxdneadcprrxgchvamniglwabkvepqivwiqsudwemihazoiqlhuxsmizhjzifxygmdxovzqvnsxcxtfwagsesoqvyzzdgavqvcqbibtcztkoksnycqhocikwimklkqdqqizxwixjheinxxsxgihxamcnuapazzbceekxatrtizxpvpftzhmmwbxkpdekdswckgplccfoykaqmhwdqqjemkhmcouywcvnnxsqpbzndwzcfvkrqdexhggaznucshgdrmzvsfenrjbvvkffrzbtakeaftgoenthjztvjtbrrtdazdwgerbwastrxtmqyafbxblubqgegiqiaxvdrebobpmwjrjuznbqqzqhcdtnyclxdfrwcgssecroipywqmbhltyummirpotfsexqplmubtodeumjjjorczryxeliuxtzqwnxrjulhxqzzeuqezotktycjbvndpupjprgirydnmkotydldfktccbvgtwhjqefgezyvcfnaswhalezkzrfjhtisfinesamyncimssowcpbqcfbmqtaqpyeerakffcozqybozsljdniaxbazsrehitrsvwyspdbokxusikpnjpglczaucqmtnmppkrafgwhmapocttufyljvgqmytdoysrjxtxlfgbsdnbstinqszuhtkvktubldmptuzrjjgtlnmwoubbinwfippgibfadpmyovmpoqdgepejqullsfdxsikppakbcglsazxolxatkpyjvebpgscxatazcycasirtwddqyneghvbwfuzjsoqhjibjsgrkhecjcjrpzrzjbqxghhppllgxcapvlharaatzfejgdjshyxramofbpvkknwddahrvelyobldfwmxifhzrmkqhiwhztjpowqgronuqwevlfpzitstzwmxtfvbegbasoapdjaimnjghemwnbmirjqbjtgbknwrrdjncfbaseuaymsbfiarjilzcvjyzwewvyrymxwiwgvztvrbmykapazsvrbipikvlpvgfbyfzfllairuitpqsxndpyngrfpjqvwtnwbosvasqmrgjbjxcmzshqbmtrngrymkrycwzbadxrnuamezvvkksyyekggffpdnmszasuensawjborimrzdlwewgbcfqmjdomwexvdowhgrfmwieplfmbycdfvowbopqxgblfiwufneaoggwwzrnthsjwswsgixkvfeuclbcquzptiuekvilguuocdprhjmajnsdggqoeyzqdggxqccesfepgdefpupgpdeohqaouegmiteiyprcsmqndmoytwophgyupsaifvlnrstccwqdgfibrpcausqzqhyzoclhpaywidsrzntlcwvxfykjgpmirwhxzbvntrmhhmxutwholzutoyxiumdfetacoqdwuipuebserajqcekbsvuhgufpnboefujokdyvcsyqurwqtangkmzwvobdbyzpovbekdeuowygmyfppydecqmpnjnluwwghxnxzofhkofmyszdgookxduggpuahrcpslupxkdyizrwetosjwejmscaxxglaliuhxonxchwdxvcrvkgstvsivaykkrpoktrvxkqwjxxiomgoewddiymuvwniyubzfctjemjlkwdzbyukgjoihcqvxokwlygtyruvrcolmpojkdolxditadpublhlxusscrrztsmcbbbqkmskdquadrglznprnzoggsalnirfeylqigkuxxfqbothcurtkelsyazvxlnfvvddhnpmmimaibiqfwaugmvlfibosinfyekajflsdtkgofewsnxjdplhkxzkyajhkltsrlmlowpwjncohzasinepkxsradiqbwylezzukapgxdritnxbxdktflgslkbdmgoddnoldyzyvaoqjtyrvfqidttgujhvkueempozmwrjfocnjqzbbenenyellejwqjqfjdzptgbxsrbunivfzgctnlefqasierucgmepzpnjwxeviudqmwunauqcwtizforapsqkaouhrmxoewpqpkrasnqtpbgiyzvkrieaepmodrtzoryhjtrrjbqejomlxfdsltlebvxyqpnyfgciabeyidgfdsggwaqlzucisqkzqjltscqifwbligmuioiukjddycilzqfapvhtqcddqsjndslmrpbgjsybnszmbqicjubpaqqzzjnndlkyazkagubzyxlrkxowruxlkqqgppogksmlyyxohcvpwjpujvyppolqcvolhvqddewicachmkinhnumbnagyafzieeeujuxzolrjjcmjghxpbfxanffcquwvpvmffseiatqmjgcilczzzpdxwwlggnpvykprhzmhplukwyipzuhvnzrifbfvoangtrgaeutxafgpduvdguvfxhrdoyhlpgebaycpfphsdljxgjlvkxrwlabunpzpkyeafcswjgdufdchlkjxkryzjwpquvamrxubayvncumttopnvpcojarwevhuvomxyduzbgpecwkxcyyaiuejfturwtcrndzgwjsmmwllykxjreejqdcuzhawrbwcucpvrgitqjbrdptasbhzagsazrwbzanweasgjepazztlkjdwudgjzhrllwptbgoegklazudxrzahirihfjwymxtgqtxcdwiyaxdmaaeteyqtdhnlekjfznluzctpdrturfptnphkzlajydljjjvubpxpyjgpyhmaidewxgkhwmmabnhhbgfkzhunstvmvaeqvsqehbeynfqjbscnldzhxjrvvuhpwygnictahdzpugzqnisdzbqlewzdxxltxabgludzqmkdbczmvqymwrsydhclekbekufwmnilrrrpbuuddpiqyrqrmxpxuzavcbwvrsvrzlzzkoxllmkfoaujuhmmanicxnqgbbdckudegysehqfvhqgoduyqgrwsrhselnmvtibzsecdzckczgyczspnshqehhjauppnwwrvbeyyurtsjvyhxsuadmdqkmquwmsbxxgjwqldocyyuztlgvgfwkvpovuulmtrftvhhndoreqsexhlppggzbjtppvosorlfefjixilauqnrclnloohxosukfhgzjaxeynnjdixrilbgumfbxvctcvmshovvykaunhduejdwdrzsajzbtkujjkvgbvngconqsfmnghiyzwcoesezuuuvsjwwxmzrsnhfeqtlaivypffbynxbnrwspyfcmlnljoiitjflqdwrztmxqmpcvvw" 1291))
22
+
23
+ test5 :: Test
24
+ test5 = TestCase (assertEqual "for (answerString \"yzooaprdvaoqzktnczenjnltzjdmcqectaqueylzpinnohpptvqtyqghnrowruhxvcppotfiwxsbwxhwaxcveqkpwjvodzqcpedsvsizgtosxeddkfrnatkebrxgmcbmfvxdmvtxpthlqazeapchclrpzwmeecktdcygffuatwwemenagsujyulaiyatfsjcyshqhukkngscafxonigiafzvprcdqocyroxkebypfntbolmiilaanjqwmnrgfmzssccnpgpxvkrpdxtaauzhakpoqjvxkkstspnmggyyywdufrlcaevwuupundwrdcqqwoiyfbtpxvlsjlfohoxcvvbjufuavfkgeheotrtvljoqetnjtarhvcurmxkvwtrkxzxmeoqayctvvqdatxuwrdpcvvhxeptymahvtvnxwiiyuelzsqjdajuhikuylgjeifnxwfxreulmwwbjzzqfrzxgynpfiubzlivwpugslghibgmpiwsizlxqxanglkdxotdkjzwdxhibwkefdbukhjftevihzjdbxpuyxbbambizysglbnencrojevquchutrvycqezrewodmkcvuqrqevzrxufplpykoecydlfoltqhnjoeofsvotgzwlwolfwraoihjdcruujefuxxfzyrxywmtdtlpjpsbtbpbwlruifpmnvdiiucebyvpewplxagwppfbpqzxjrzvyqctlaoszbkdygxokltzxpsykinjikrxkcurkhtbtaggmovxycizchgftsadkjydegfzvvbrqbiemauxmuqukxclttphdixjamaacrgudgqsmdhdwrwebmlesdgmyfqqygntnwzxudrraouawkoybwjoplkualabfkuxtcqpvlvofxollodfhfvbdqathriydcphjiivtkfhinlbqkvgwwevhlsfwbaavbjlyvypqhsrdliaplcpmwnoccjadfjfhotekewomwnifgjfcierbevacpvpqcywkimogzlhjslbmumqtmkgirbxxpnksprfhpefdkbjlfinmbyhagofwaaquaphbleyfqwmzjuvmhmnltjzhptpjmhoibaiyguimougynbracmesntljqcthdcjqhpqapwfiihxmjuwubsaeesjrdokumdimylyagmvsplbmjagrgtwrfpbosnmyxggbllkspqvnvuzdcydziipbhafkqbqjhsiswcdozahuqeydefkydbyrpotgkflndtggouvigfnfqoruyrigbkscvgvgplkspypzrltujfjdfwnonchxvtjxorqnlkaxuxfzieyksvqdvubkinpnlmulkzovsvjxquudwwenghfrojboxttmmsijdmvbqdqniequbzsmmsoptkmqejrxzjeaxjglntlqvvfekeezushdwdryixvamiwzutczzddsqymfailndskrdyxblgsfpaejyccriktkbphddhgrwfkxzonogpuyosngmuifoxqtnrktkfoisiqqujhngvptdpdsaycnvjifitmdfrhhfqptungactlootfphwghanttufuuwqvjnmscfkruzqnddrzfgcwmkhzymviiyvoveupbwlllvnyfjdxfdjkkrjarjhpbpodcktqerodbyzjomsdjggvfksajhtxsjqsjqxknclnzglzytxfoqbcnrtkxpjetjpfjthhhmkqvtgazybaeltwsmwhnpttwleovrdzccjmuenuhdwtatrfadcbjhbkplpoomqvcxjyxekmmicqljlezrgwtgcthjizpkluavdjezhivcnoecahsrxlzzcqfagoitjstqcrdwaxfhnxytlyliqpeffxyrzpmkdmvcgcluepcpmensdkwyrnyqmdqcpcwhozdfynkjdtkmvlayotfuedjlysdzzxaecjqqijstfyvnfnacupvgwjlvbizvicdgdjsyvrdabzelxykfiixkfrneqfvbqmnyimcadkkfpvimfkwlehlhypukitwzgdcsuxsrgtccwxjmlzmudinym \" 1155)," "zzxaecjqqijstfyvnfnacupvgwjlvbizvicdgdjsyvrdabzelxykfiixkfrneqfvbqmnyimcadkkfpvimfkwlehlhypukitwzgdcsuxsrgtccwxjmlzmudinym" (answerString "yzooaprdvaoqzktnczenjnltzjdmcqectaqueylzpinnohpptvqtyqghnrowruhxvcppotfiwxsbwxhwaxcveqkpwjvodzqcpedsvsizgtosxeddkfrnatkebrxgmcbmfvxdmvtxpthlqazeapchclrpzwmeecktdcygffuatwwemenagsujyulaiyatfsjcyshqhukkngscafxonigiafzvprcdqocyroxkebypfntbolmiilaanjqwmnrgfmzssccnpgpxvkrpdxtaauzhakpoqjvxkkstspnmggyyywdufrlcaevwuupundwrdcqqwoiyfbtpxvlsjlfohoxcvvbjufuavfkgeheotrtvljoqetnjtarhvcurmxkvwtrkxzxmeoqayctvvqdatxuwrdpcvvhxeptymahvtvnxwiiyuelzsqjdajuhikuylgjeifnxwfxreulmwwbjzzqfrzxgynpfiubzlivwpugslghibgmpiwsizlxqxanglkdxotdkjzwdxhibwkefdbukhjftevihzjdbxpuyxbbambizysglbnencrojevquchutrvycqezrewodmkcvuqrqevzrxufplpykoecydlfoltqhnjoeofsvotgzwlwolfwraoihjdcruujefuxxfzyrxywmtdtlpjpsbtbpbwlruifpmnvdiiucebyvpewplxagwppfbpqzxjrzvyqctlaoszbkdygxokltzxpsykinjikrxkcurkhtbtaggmovxycizchgftsadkjydegfzvvbrqbiemauxmuqukxclttphdixjamaacrgudgqsmdhdwrwebmlesdgmyfqqygntnwzxudrraouawkoybwjoplkualabfkuxtcqpvlvofxollodfhfvbdqathriydcphjiivtkfhinlbqkvgwwevhlsfwbaavbjlyvypqhsrdliaplcpmwnoccjadfjfhotekewomwnifgjfcierbevacpvpqcywkimogzlhjslbmumqtmkgirbxxpnksprfhpefdkbjlfinmbyhagofwaaquaphbleyfqwmzjuvmhmnltjzhptpjmhoibaiyguimougynbracmesntljqcthdcjqhpqapwfiihxmjuwubsaeesjrdokumdimylyagmvsplbmjagrgtwrfpbosnmyxggbllkspqvnvuzdcydziipbhafkqbqjhsiswcdozahuqeydefkydbyrpotgkflndtggouvigfnfqoruyrigbkscvgvgplkspypzrltujfjdfwnonchxvtjxorqnlkaxuxfzieyksvqdvubkinpnlmulkzovsvjxquudwwenghfrojboxttmmsijdmvbqdqniequbzsmmsoptkmqejrxzjeaxjglntlqvvfekeezushdwdryixvamiwzutczzddsqymfailndskrdyxblgsfpaejyccriktkbphddhgrwfkxzonogpuyosngmuifoxqtnrktkfoisiqqujhngvptdpdsaycnvjifitmdfrhhfqptungactlootfphwghanttufuuwqvjnmscfkruzqnddrzfgcwmkhzymviiyvoveupbwlllvnyfjdxfdjkkrjarjhpbpodcktqerodbyzjomsdjggvfksajhtxsjqsjqxknclnzglzytxfoqbcnrtkxpjetjpfjthhhmkqvtgazybaeltwsmwhnpttwleovrdzccjmuenuhdwtatrfadcbjhbkplpoomqvcxjyxekmmicqljlezrgwtgcthjizpkluavdjezhivcnoecahsrxlzzcqfagoitjstqcrdwaxfhnxytlyliqpeffxyrzpmkdmvcgcluepcpmensdkwyrnyqmdqcpcwhozdfynkjdtkmvlayotfuedjlysdzzxaecjqqijstfyvnfnacupvgwjlvbizvicdgdjsyvrdabzelxykfiixkfrneqfvbqmnyimcadkkfpvimfkwlehlhypukitwzgdcsuxsrgtccwxjmlzmudinym" 1155))
25
+
26
+ test6 :: Test
27
+ test6 = TestCase (assertEqual "for (answerString \"yseprefyjfiyksuqcgzhqrijhdtiusveffpnftzzqaasfbfdrjevnpkhnrnlmhghqhfpypdlbuxoezqguckuldgmziflprrcuwwnnrtfvmxlvyvnfcluunhlyujgbwmnvhvvuwtnvzybvixyfnecrwvgnhlsubeqfhmacezswjbvsapofisvregebwmmlyuwthxrfmdlmniiycndrhiedwytuozlxaszhqejgcnptaowzsyevtroaoogidvlnwlmtzqhotuzmmaxonoxfogrewqbulafhwqnpxbyfhdcluysxhqsfbcjxwfjlujycevnjtkaguipxnebkiyiaspczmhjgqnajcpaglfcmwmbesbjmwsxccihpyhvjsxmzngwmbadiumcvqbmucwuhnswwusbexainqjwuedpjcsanmbctufubojdtycnzvikcsqzrrccbzfxjccjivhtmfdddptkfspdhzwmawwymcnyvzbvduocnktmdtbqmtbefdztvhgzwfqzxmragglgelmbqzouqnzvafptuxkabzbeffpytnsppnvfwvvvdnokuzlkniddhneeiqmpkzfbqdcxawkxpyyypjspegllflricvlaavfozwycnuaefhliaklmapgkfhrpypkxbmrbxeggqcwcwmgrqrenchnfkloxtcddzpklsdacuwdimnvgsnwadtmyotjrbzzxeifphgdtfvtwwngpecuztccfceinndrgbfazdofhpkpjwpadpxyoxclwkthrxeduifauwbmklyjsysppjwrkfasnhdqttyzybaatplakupvqvpaurbfrvzygnzumlsycoqwddibmzkmvfrupvsjcsldinjtyvkinjliawmxzvrpuikobiesrtqnfbdeukctnsvieqpbmzjoedudiqdifkjbapgpbymplxtfllxsiuwrveryolzmwvuzyetfrellwivwidhgrdmhhcxwcyqlebtvrsfmxcobandiszzomoefkepzsvjjbyrmitthmzibdhdipwlnrnxrehnwbkofvxwckqaqbdelxqphnqhmwezzpyouvvlsayhahraximkmduxbzvlerexotcnuwvhwwnvnssuvcpvhyidouswfxftcmqpichaiydigyvvjxhnfrnahcpdfpqxmyvncplydsqpqtymnuhodmfyentoarnadqjwyicdjkcbqepcepjrwnlekkrhhmnrhanllomioueomzqhufjakfyzyydnzizujaivzrzmtqkbambtendtlgvcuvvcayqkhwpvqgrjoavuwcfzwwtutnnrelztvqqtmlebzmtklvvraonwroamhdfxhrqmzimvnoomfxkryyhgxexzmofgurgzndxagixxaxlqepapepyniqjvfhclawlmvrdfcnsgntzdcuolfzfvmrepnbypzovxvdboubjfkinegrhlzcbcuiwwapsvmzwtrbszdpztcrwtctpqvyafzybkavdnkydmkzewwaklypahnwlracyozijimduggoxuypqlwwefebsjbvracqyaakksrckcrxbgrpqlvvduedqwzrpexpqlorsjxiekattpyiobateoayfvnobzwhghftzsjnkapagtjwuvwgmqalpflfmbxnvyylliivoakjffqivwgxadpgmofazoujslpbmwsvtfqmxjufngwnqlgsbmmjmmmccybsbabjkeauwlqnaapfzfzfzxoajvyforjhmzkxfuphhvndpmytftdisdpbyvgjegpkmzvrzpklidumrxhwelilkaryvitffsezrmgdrhkfbntrnyhadfbieebtxaovwkojarijpaswbsaixhegtplyvccwwhggqfmqpdudermtkwokhdaqpqvswtsmborzbgyzzlnfumzfavyvvgoztlgghzmnwtisouzbdvwxguxkfigntfgkvlrmmbnotusdrufvcyclstssdkgotccgururaasjaighwzwsvzwrtguxlztvnhrixtgomjjhmwlrylchbukdjvfhppnuufezswgaplsczmwxnscnpovihuvftoahwjqamuiwkygkcosfggimvgspnzedrddkjsxmrlgenkursnrjclkfznxvjlimhwmoghealhoskuntkluwbaafzvutlqvvvlaprnfszqehlobbgrdcrwudfhdkdpuexusjiubynhrrfhkeitdaicskbmasrvuaypmtrpweqwtipmtvzfvpafgddfxmkblinuytnjncoldblmmwbqvsritbwrscftewryhbxdrxcgmwecblufxbkhazoqvzgjpsrohcovautkplmcunaesvfneycnqonizybpzmfkzeuuwwlajqytgitcjnyvfbyvlitbxmumqvybhzeeleekfggglhhrruqfeovwtjybxilvifoklxzstwnvogpyqoulticefckqfpydrhv \" 866)," "zzxeifphgdtfvtwwngpecuztccfceinndrgbfazdofhpkpjwpadpxyoxclwkthrxeduifauwbmklyjsysppjwrkfasnhdqttyzybaatplakupvqvpaurbfrvzygnzumlsycoqwddibmzkmvfrupvsjcsldinjtyvkinjliawmxzvrpuikobiesrtqnfbdeukctnsvieqpbmzjoedudiqdifkjbapgpbymplxtfllxsiuwrveryolzmwvuzyetfrellwivwidhgrdmhhcxwcyqlebtvrsfmxcobandiszzomoefkepzsvjjbyrmitthmzibdhdipwlnrnxrehnwbkofvxwckqaqbdelxqphnqhmwezzpyouvvlsayhahraximkmduxbzvlerexotcnuwvhwwnvnssuvcpvhyidouswfxftcmqpichaiydigyvvjxhnfrnahcpdfpqxmyvncplydsqpqtymnuhodmfyentoarnadqjwyicdjkcbqepcepjrwnlekkrhhmnrhanllomioueomzqhufjakfyzyydnzizujaivzrzmtqkbambtendtlgvcuvvcayqkhwpvqgrjoavuwcfzwwtutnnrelztvqqtmlebzmtklvvraonwroamhdfxhrqmzimvnoomfxkryyhgxexzmofgurgzndxagixxaxlqepapepyniqjvfhclawlmvrdfcnsgntzdcuolfzfvmrepnbypzovxvdboubjfkinegrhlzcbcuiwwapsvmzwtrbszdpztcrwtctpqvyafzybkavdnkydmkzewwaklypahnwlracyozijimduggoxuypqlwwefebsjbvracqyaakksrckcrxbgrpqlvvduedqwzrpexpqlorsjxiekattpyiobateoayfvnobzwhghftzsjnkapagtjwuvwgmqalpflfmbxnvyylliivoakjffqivwgxadpgmofazoujslpbmwsvtfqmxjufngwnqlgsbmmjmmmccybsbabjkeauwlqnaapfzfzfzxoajvyforjhmzkxfuphhvndpmytftdisdpbyvgjegpkmzvrzpklidumrxhwelilkaryvitffsezrmgdrhkfbntrnyhadfbieebtxaovwkojarijpaswbsaixhegtplyvccwwhggqfmqpdudermtkwokhdaqpqvswtsmborzbgyzzlnfumzfavyvvgoztlgghzmnwtisouzbdvwxguxkfigntfgkvlrmmbnotusdrufvcyclstssdkgotccgururaasjaighwzwsvzwrtguxlztvnhrixtgomjjhmwlrylchbukdjvfhppnuufezswgaplsczmwxnscnpovihuvftoahwjqamuiwkygkcosfggimvgspnzedrddkjsxmrlgenkursnrjclkfznxvjlimhwmoghealhoskuntkluwbaafzvutlqvvvlaprnfszqehlobbgrdcrwudfhdkdpuexusjiubynhrrfhkeitdaicskbmasrvuaypmtrpweqwtipmtvzfvpafgddfxmkblinuytnjncoldblmmwbqvsritbwrscftewryhbxdrxcgmwecblufxbk" (answerString "yseprefyjfiyksuqcgzhqrijhdtiusveffpnftzzqaasfbfdrjevnpkhnrnlmhghqhfpypdlbuxoezqguckuldgmziflprrcuwwnnrtfvmxlvyvnfcluunhlyujgbwmnvhvvuwtnvzybvixyfnecrwvgnhlsubeqfhmacezswjbvsapofisvregebwmmlyuwthxrfmdlmniiycndrhiedwytuozlxaszhqejgcnptaowzsyevtroaoogidvlnwlmtzqhotuzmmaxonoxfogrewqbulafhwqnpxbyfhdcluysxhqsfbcjxwfjlujycevnjtkaguipxnebkiyiaspczmhjgqnajcpaglfcmwmbesbjmwsxccihpyhvjsxmzngwmbadiumcvqbmucwuhnswwusbexainqjwuedpjcsanmbctufubojdtycnzvikcsqzrrccbzfxjccjivhtmfdddptkfspdhzwmawwymcnyvzbvduocnktmdtbqmtbefdztvhgzwfqzxmragglgelmbqzouqnzvafptuxkabzbeffpytnsppnvfwvvvdnokuzlkniddhneeiqmpkzfbqdcxawkxpyyypjspegllflricvlaavfozwycnuaefhliaklmapgkfhrpypkxbmrbxeggqcwcwmgrqrenchnfkloxtcddzpklsdacuwdimnvgsnwadtmyotjrbzzxeifphgdtfvtwwngpecuztccfceinndrgbfazdofhpkpjwpadpxyoxclwkthrxeduifauwbmklyjsysppjwrkfasnhdqttyzybaatplakupvqvpaurbfrvzygnzumlsycoqwddibmzkmvfrupvsjcsldinjtyvkinjliawmxzvrpuikobiesrtqnfbdeukctnsvieqpbmzjoedudiqdifkjbapgpbymplxtfllxsiuwrveryolzmwvuzyetfrellwivwidhgrdmhhcxwcyqlebtvrsfmxcobandiszzomoefkepzsvjjbyrmitthmzibdhdipwlnrnxrehnwbkofvxwckqaqbdelxqphnqhmwezzpyouvvlsayhahraximkmduxbzvlerexotcnuwvhwwnvnssuvcpvhyidouswfxftcmqpichaiydigyvvjxhnfrnahcpdfpqxmyvncplydsqpqtymnuhodmfyentoarnadqjwyicdjkcbqepcepjrwnlekkrhhmnrhanllomioueomzqhufjakfyzyydnzizujaivzrzmtqkbambtendtlgvcuvvcayqkhwpvqgrjoavuwcfzwwtutnnrelztvqqtmlebzmtklvvraonwroamhdfxhrqmzimvnoomfxkryyhgxexzmofgurgzndxagixxaxlqepapepyniqjvfhclawlmvrdfcnsgntzdcuolfzfvmrepnbypzovxvdboubjfkinegrhlzcbcuiwwapsvmzwtrbszdpztcrwtctpqvyafzybkavdnkydmkzewwaklypahnwlracyozijimduggoxuypqlwwefebsjbvracqyaakksrckcrxbgrpqlvvduedqwzrpexpqlorsjxiekattpyiobateoayfvnobzwhghftzsjnkapagtjwuvwgmqalpflfmbxnvyylliivoakjffqivwgxadpgmofazoujslpbmwsvtfqmxjufngwnqlgsbmmjmmmccybsbabjkeauwlqnaapfzfzfzxoajvyforjhmzkxfuphhvndpmytftdisdpbyvgjegpkmzvrzpklidumrxhwelilkaryvitffsezrmgdrhkfbntrnyhadfbieebtxaovwkojarijpaswbsaixhegtplyvccwwhggqfmqpdudermtkwokhdaqpqvswtsmborzbgyzzlnfumzfavyvvgoztlgghzmnwtisouzbdvwxguxkfigntfgkvlrmmbnotusdrufvcyclstssdkgotccgururaasjaighwzwsvzwrtguxlztvnhrixtgomjjhmwlrylchbukdjvfhppnuufezswgaplsczmwxnscnpovihuvftoahwjqamuiwkygkcosfggimvgspnzedrddkjsxmrlgenkursnrjclkfznxvjlimhwmoghealhoskuntkluwbaafzvutlqvvvlaprnfszqehlobbgrdcrwudfhdkdpuexusjiubynhrrfhkeitdaicskbmasrvuaypmtrpweqwtipmtvzfvpafgddfxmkblinuytnjncoldblmmwbqvsritbwrscftewryhbxdrxcgmwecblufxbkhazoqvzgjpsrohcovautkplmcunaesvfneycnqonizybpzmfkzeuuwwlajqytgitcjnyvfbyvlitbxmumqvybhzeeleekfggglhhrruqfeovwtjybxilvifoklxzstwnvogpyqoulticefckqfpydrhv" 866))
28
+
29
+ test7 :: Test
30
+ test7 = TestCase (assertEqual "for (answerString \"upjrxnvfaddgmgbdnwjitnmnwdinoloslhxratpspztrcwlhfctpwszozhxnonbehtswvxcvazybgxgpivorjasxbsdgwtczqcshewbuwdrugmmcpudycwjrokgmamslymdnyhxxejnlupwlvqrfqukiulronntnajgxtihlfoklykeeonoxhubgnjkbmndxhnnxazlitutmianfhtkfkbpfzoelexmugfhnyvsyrfhrnemtqikzpvtjiakxreuzzwxdczngdklqaiqtvqspqnbzwosgvmldlrwcucsiwmuveiokojvdxtcpbutojndmjqinpkxrchqglopowrzvbvawtneqpvkbqzbwoepbozhwwbxxxnbzqpsmoclretffjliskxkirgfgwuasebvwhcdxrodakjnvqfgmzrfzoucpsywbayscwelzgcduicxohcdewzngmwvkxmqatpkrdbwmwfvmtyupmqwukuazraubnsesvauirttvdsehwdtmincrsxvdpmyyvnblnnffsijtduutrswdckviakzlegssikizfpyspdvqatrxlpvvfrjqeqsizdetwnovzqkcqrvzytxrjizkzdhdyfvqxkopwfbejmmidnjymreldtdaoxlcllzsazsnejqdsrmtpbirsmxgjipcoqjonwphsrybvcjtaklyqsrhrnugtruhbnszdzjteoyjsliigpmckjoxhtixoskjmmaixkfccwpjglojvxewhcjaphypzmccppjlgokcqeepxngxmlksdxmyameinxhzjolvliplryjqqehersizvnnhgfcjtrftkhrpzkdilkrxlindhehfxxarksjxhzwevhfcehrftfwbnabfovvsiebyeicollnxitaewnwemmskrsjqiwzzcnmfefzoyyefzmvbclndmicfyicjfmmzkuzsnvbjxnvduqkivkregbxjcoemanzavzfoesgxquyyrgaywqqmhejsnlegsoyopqbitzcgipkosolbhhytstebqyqlaaqoukdvoecetgprgtycdyaanpdiifsikbberdnljwertlrswmvmwsnjwtzanwfkevemejfxmjzhxgmokogisgsjaxlsrhwvpbkkyoybypmawclymfpvhtdeyggwtgapxszgoctbpimitekvkohcleqspddrtvuynycqfhpusubsqqcwfysjlcbajqqmotzrczmlkvcdxbnghmlufqsetrznxizdnmayecqrlmyinznsjnqmmiuytvvvkocukisovkaouqwrpqkryvxtzhigixadptczqkkmkbjeyypffkwwhfvijdpplxvadoioduqfxxclabxqifdnbqrvfhr \" 660)," "zzwxdczngdklqaiqtvqspqnbzwosgvmldlrwcucsiwmuveiokojvdxtcpbutojndmjqinpkxrchqglopowrzvbvawtneqpvkbqzbwoepbozhwwbxxxnbzqpsmoclretffjliskxkirgfgwuasebvwhcdxrodakjnvqfgmzrfzoucpsywbayscwelzgcduicxohcdewzngmwvkxmqatpkrdbwmwfvmtyupmqwukuazraubnsesvauirttvdsehwdtmincrsxvdpmyyvnblnnffsijtduutrswdckviakzlegssikizfpyspdvqatrxlpvvfrjqeqsizdetwnovzqkcqrvzytxrjizkzdhdyfvqxkopwfbejmmidnjymreldtdaoxlcllzsazsnejqdsrmtpbirsmxgjipcoqjonwphsrybvcjtaklyqsrhrnugtruhbnszdzjteoyjsliigpmckjoxhtixoskjmmaixkfccwpjglojvxewhcjaphypzmccppjlgokcqeepxngxmlksdxmyameinxhzjolvliplryjqqehersizvnnhgfcjtrftkhrpzkdilkrxlindhehfxxarksjxhzwevhfcehrftfwbnabfovvsiebyeicollnxitaewnwemmskrsjqiwzzcnmfefzoyyefzmvbclndmicfyicjfmmzkuzsnvbjxnvduqkivkregbxjcoe" (answerString "upjrxnvfaddgmgbdnwjitnmnwdinoloslhxratpspztrcwlhfctpwszozhxnonbehtswvxcvazybgxgpivorjasxbsdgwtczqcshewbuwdrugmmcpudycwjrokgmamslymdnyhxxejnlupwlvqrfqukiulronntnajgxtihlfoklykeeonoxhubgnjkbmndxhnnxazlitutmianfhtkfkbpfzoelexmugfhnyvsyrfhrnemtqikzpvtjiakxreuzzwxdczngdklqaiqtvqspqnbzwosgvmldlrwcucsiwmuveiokojvdxtcpbutojndmjqinpkxrchqglopowrzvbvawtneqpvkbqzbwoepbozhwwbxxxnbzqpsmoclretffjliskxkirgfgwuasebvwhcdxrodakjnvqfgmzrfzoucpsywbayscwelzgcduicxohcdewzngmwvkxmqatpkrdbwmwfvmtyupmqwukuazraubnsesvauirttvdsehwdtmincrsxvdpmyyvnblnnffsijtduutrswdckviakzlegssikizfpyspdvqatrxlpvvfrjqeqsizdetwnovzqkcqrvzytxrjizkzdhdyfvqxkopwfbejmmidnjymreldtdaoxlcllzsazsnejqdsrmtpbirsmxgjipcoqjonwphsrybvcjtaklyqsrhrnugtruhbnszdzjteoyjsliigpmckjoxhtixoskjmmaixkfccwpjglojvxewhcjaphypzmccppjlgokcqeepxngxmlksdxmyameinxhzjolvliplryjqqehersizvnnhgfcjtrftkhrpzkdilkrxlindhehfxxarksjxhzwevhfcehrftfwbnabfovvsiebyeicollnxitaewnwemmskrsjqiwzzcnmfefzoyyefzmvbclndmicfyicjfmmzkuzsnvbjxnvduqkivkregbxjcoemanzavzfoesgxquyyrgaywqqmhejsnlegsoyopqbitzcgipkosolbhhytstebqyqlaaqoukdvoecetgprgtycdyaanpdiifsikbberdnljwertlrswmvmwsnjwtzanwfkevemejfxmjzhxgmokogisgsjaxlsrhwvpbkkyoybypmawclymfpvhtdeyggwtgapxszgoctbpimitekvkohcleqspddrtvuynycqfhpusubsqqcwfysjlcbajqqmotzrczmlkvcdxbnghmlufqsetrznxizdnmayecqrlmyinznsjnqmmiuytvvvkocukisovkaouqwrpqkryvxtzhigixadptczqkkmkbjeyypffkwwhfvijdpplxvadoioduqfxxclabxqifdnbqrvfhr" 660))
31
+
32
+ test8 :: Test
33
+ test8 = TestCase (assertEqual "for (answerString \"wquhoneqekcevqizamfwmguyoxzzwaayqoajgorzwnsztazyqntvkmtatrzhlgnqvnfeldfmbeeyehczxuxsnpdflphokxaqrouniyjdenomwlxfwghiaffevhzdcmwfwcylwpjzijvdgxjiaafxtqzjvenuiyapiyzzxpgpxmowxyqxgphwbjvckmmfxprfhkuvsjebhqxxplktjixcackcahmnyhsaxrnulfazdnrwsqyebhckdbqmrwtyabiyolpbcsvgrcerknoxhjjgfqtlfstdbomlkfmvadfbjqeqfabtihllgmxxyuctdavrhekslplawkpcrjmsxhomtconljllbwzlghdvtdsvhcyslsylggsjgziaklczrdvbvtayhceqwnpjsfpglhflmxupngrsffokcaezoxukjohpgbqdmbnqxueodaqodeisnojffczlhjivvcwhlinonvsinjmpcsbwspksmhsbymijbuyqxqerlmwtrrdafegyftlwzgvibkqfcuiszbqbyapfudraxfjwhdaxpvkwrldngfsvcqadsthifmslzbywxmpelecohuxjifqwdlpqkesmkegzkzprsxjnrqpcdjcwyfkzjogrqctalkwipgornikmakospakcdnbppobtauezamyuhaguanhyoscljsafgijruwnxhivjazayfbzvosbhhwmatbxjfyienzxerkkgkucwjzckrjtvrncytkoobumiaqrdftutccznamwpsjyopgegcpitjnqxjkkoanbsxenkevpjslazopnaqtqhkpujkwifzhsvopzpvixhzmhzwcodboyefaycyzfnrpavnrhvjrefbsmyljriqimfzpjeydnqinwtjnombbxclavumletelyyszyicolrowrgcybeerxppalihmpqkawlpthivsxledbhwixjykfftckysdpgsqozteespojtilthagpslhpowrrppjzmxqyamyljnrfpdfnppjsprtwmjvpxaayazwvisafxzbsbuggmjiapbhkjfepitegvawaohtfooaujuiwwqichdypoklfgizfpvyqdgeqgxineilzoljhattpkowyqnwsjarkdrcqlgwkcjroncqtrmqmlccukdgrphaqbhtaijcyxwdnfsffcmwjgiwasthrqxemgwrospprakvjyzagdmxkbzyklpyqbjzhxcysboftspbjbrgilhyzvbcpixvgboryoenrbwesctspqangwzngeurzznxeyazqpmvzmhndpxbwasckadxidfgyrvfxwsqecfuwjdurxlzlxujkgjiuisriwwytqbrctsnazhyrspejqfusoltzfehvxmnuhiriuhsaptwxkxohnezuvgfbquuntiopgoxytfcveyrxrbmenrsdlnjylveskwtqbkfccikoszkufaifhxypuoimuhaaljqsrhmhbdfatdigkabgpflcpvkrliohqzxdftpwjzoukraetlbzujrynjsqkskfhzvzvpoajtlelnioipqohujrvzfexhfieezbfkudlgroxcliuzbetjeyltlddszdbwshlrgorsbxkqzzdrrqgtuejopyembnszbtlbyflucgvqgriglqtvqwmawgncuidsapdbcrhwxviyotqidzjpbbkcizxsglfmxnlnzqglnkwdtwnctdowiznztipjzscnefqhkkeeraznemddmadxcljrtrrvcjoejlhpadhhveoejvhbqlpmlfpfbjyyqjdjmdzmbmbhnaxgskiyogijmbdyhlqaxzyfarlbrxwcewehlrjrekrtgehufrbvqrohjncywgoyuyyxukxyqleumizhoepekrzzcaviupwolefyozbmyfttavgwfwcacxdbdqhytpxsvffkaohwcszcshjkdlvnuicndsryxypftvxywpfelwerwlwhnypeomxavglwukcztbbjlsiujwzxcdtbwrpjmhrcdqkurufmypmxqsaeghzyyluatbbzgzahhiwkwlgxnwmxmqaomxweyftcnnfggrqttkejgmdhpbtisffcmqnxmmgvpsqlontiizxecjuvuhigbidyorienlfbgucbjvjyfpdawmfrrfcewvqtbhdyttwoayllkujujlkidkledkveupnnumlqrcspjge \" 409)," "zzxpgpxmowxyqxgphwbjvckmmfxprfhkuvsjebhqxxplktjixcackcahmnyhsaxrnulfazdnrwsqyebhckdbqmrwtyabiyolpbcsvgrcerknoxhjjgfqtlfstdbomlkfmvadfbjqeqfabtihllgmxxyuctdavrhekslplawkpcrjmsxhomtconljllbwzlghdvtdsvhcyslsylggsjgziaklczrdvbvtayhceqwnpjsfpglhflmxupngrsffokcaezoxukjohpgbqdmbnqxueodaqodeisnojffczlhjivvcwhlinonvsinjmpcsbwspksmhsbymijbuyqxqerlmwtrrdafegyftlwzgvibkqfcuiszbqbyapfudraxfjwhdaxpvkwrldngfsvcqadsthifmslzbywxmpelecohuxjifqwdlpqkesmkegzkzprsxjnrqpcdjcwyfkzjogrqctalkwipgornikmakospakcdnbppobtauezamyuhaguanhyoscljsafgijruwnxhivjazayfbzvosbhhwmatbxjfyienzxerkkgkucwjzckrjtvrncytkoobumiaqrdftutccznamwpsjyopgegcpitjnqxjkkoanbsxenkevpjslazopnaqtqhkpujkwifzhsvopzpvixhzmhzwcodboyefaycyzfnrpavnrhvjrefbsmyljriqimfzpjeydnqinwtjnombbxclavumletelyyszyicolrowrgcybeerxppalihmpqkawlpthivsxledbhwixjykfftckysdpgsqozteespojtilthagpslhpowrrppjzmxqyamyljnrfpdfnppjsprtwmjvpxaayazwvisafxzbsbuggmjiapbhkjfepitegvawaohtfooaujuiwwqichdypoklfgizfpvyqdgeqgxineilzoljhattpkowyqnwsjarkdrcqlgwkcjroncqtrmqmlccukdgrphaqbhtaijcyxwdnfsffcmwjgiwasthrqxemgwrospprakvjyzagdmxkbzyklpyqbjzhxcysboftspbjbrgilhyzvbcpixvgboryoenrbwesctspqangwzngeurzznxeyazqpmvzmhndpxbwasckadxidfgyrvfxwsqecfuwjdurxlzlxujkgjiuisriwwytqbrctsnazhyrspejqfusoltzfehvxmnuhiriuhsaptwxkxohnezuvgfbquuntiopgoxytfcveyrxrbmenrsdlnjylveskwtqbkfccikoszkufaifhxypuoimuhaaljqsrhmhbdfatdigkabgpflcpvkrliohqzxdftpwjzoukraetlbzujrynjsqkskfhzvzvpoajtlelnioipqohujrvzfexhfieezbfkudlgroxcliuzbetjeyltlddszdbwshlrgorsbxkqzzdrrqgtuejopyembnszbtlbyflucgvqgriglqtvqwmawgncuidsapdbcrhwxviyotqidzjpbbkcizxsglfmxnlnzqglnkwdtwnctdowiznztipjzscnefqhkkeeraznemddmadxcljrtrrvcjoejlhpadhhveoejvhbqlpmlfpfbjyyqjdjmdzmbmbhnaxgskiyogijmbdyhlqaxzyfarlbrxwcewehlrjrekrtgehufrbvqrohjncywgoyuyyxukxyqleumizhoepekrzzcaviupwolefyozbmyfttavgwfwcacxdbdqhytpxsvffkaohwcszcshjkdlvnuicndsryx" (answerString "wquhoneqekcevqizamfwmguyoxzzwaayqoajgorzwnsztazyqntvkmtatrzhlgnqvnfeldfmbeeyehczxuxsnpdflphokxaqrouniyjdenomwlxfwghiaffevhzdcmwfwcylwpjzijvdgxjiaafxtqzjvenuiyapiyzzxpgpxmowxyqxgphwbjvckmmfxprfhkuvsjebhqxxplktjixcackcahmnyhsaxrnulfazdnrwsqyebhckdbqmrwtyabiyolpbcsvgrcerknoxhjjgfqtlfstdbomlkfmvadfbjqeqfabtihllgmxxyuctdavrhekslplawkpcrjmsxhomtconljllbwzlghdvtdsvhcyslsylggsjgziaklczrdvbvtayhceqwnpjsfpglhflmxupngrsffokcaezoxukjohpgbqdmbnqxueodaqodeisnojffczlhjivvcwhlinonvsinjmpcsbwspksmhsbymijbuyqxqerlmwtrrdafegyftlwzgvibkqfcuiszbqbyapfudraxfjwhdaxpvkwrldngfsvcqadsthifmslzbywxmpelecohuxjifqwdlpqkesmkegzkzprsxjnrqpcdjcwyfkzjogrqctalkwipgornikmakospakcdnbppobtauezamyuhaguanhyoscljsafgijruwnxhivjazayfbzvosbhhwmatbxjfyienzxerkkgkucwjzckrjtvrncytkoobumiaqrdftutccznamwpsjyopgegcpitjnqxjkkoanbsxenkevpjslazopnaqtqhkpujkwifzhsvopzpvixhzmhzwcodboyefaycyzfnrpavnrhvjrefbsmyljriqimfzpjeydnqinwtjnombbxclavumletelyyszyicolrowrgcybeerxppalihmpqkawlpthivsxledbhwixjykfftckysdpgsqozteespojtilthagpslhpowrrppjzmxqyamyljnrfpdfnppjsprtwmjvpxaayazwvisafxzbsbuggmjiapbhkjfepitegvawaohtfooaujuiwwqichdypoklfgizfpvyqdgeqgxineilzoljhattpkowyqnwsjarkdrcqlgwkcjroncqtrmqmlccukdgrphaqbhtaijcyxwdnfsffcmwjgiwasthrqxemgwrospprakvjyzagdmxkbzyklpyqbjzhxcysboftspbjbrgilhyzvbcpixvgboryoenrbwesctspqangwzngeurzznxeyazqpmvzmhndpxbwasckadxidfgyrvfxwsqecfuwjdurxlzlxujkgjiuisriwwytqbrctsnazhyrspejqfusoltzfehvxmnuhiriuhsaptwxkxohnezuvgfbquuntiopgoxytfcveyrxrbmenrsdlnjylveskwtqbkfccikoszkufaifhxypuoimuhaaljqsrhmhbdfatdigkabgpflcpvkrliohqzxdftpwjzoukraetlbzujrynjsqkskfhzvzvpoajtlelnioipqohujrvzfexhfieezbfkudlgroxcliuzbetjeyltlddszdbwshlrgorsbxkqzzdrrqgtuejopyembnszbtlbyflucgvqgriglqtvqwmawgncuidsapdbcrhwxviyotqidzjpbbkcizxsglfmxnlnzqglnkwdtwnctdowiznztipjzscnefqhkkeeraznemddmadxcljrtrrvcjoejlhpadhhveoejvhbqlpmlfpfbjyyqjdjmdzmbmbhnaxgskiyogijmbdyhlqaxzyfarlbrxwcewehlrjrekrtgehufrbvqrohjncywgoyuyyxukxyqleumizhoepekrzzcaviupwolefyozbmyfttavgwfwcacxdbdqhytpxsvffkaohwcszcshjkdlvnuicndsryxypftvxywpfelwerwlwhnypeomxavglwukcztbbjlsiujwzxcdtbwrpjmhrcdqkurufmypmxqsaeghzyyluatbbzgzahhiwkwlgxnwmxmqaomxweyftcnnfggrqttkejgmdhpbtisffcmqnxmmgvpsqlontiizxecjuvuhigbidyorienlfbgucbjvjyfpdawmfrrfcewvqtbhdyttwoayllkujujlkidkledkveupnnumlqrcspjge" 409))
34
+
35
+ test9 :: Test
36
+ test9 = TestCase (assertEqual "for (answerString \"wwdowzbekluwilhhnrzhnbubunwkkphgtuyzljaqfvclcpfydhvrfjylvyrbdisitfwnkfwrvijcqsmgwqhwiskstvhfmdwivkvxbukxphnyxsamdprqhsnvozarqqgvarlgkejdimikelfzkeqtiexjmafpbrwypncraqpkzrvdzbmidapqpbjqsguyrrdbhgdkwsmzemnmaplcabcqhcpqbakqqrhngsixhnalapafasaqggpariabveqbbsnecvwleddsfhsbyrltsjkctrnociutrwnwaxitgyiazpvwojrnsfitvpjsqwibvzumptncffmllhcbrmgcudxqecpetpkhoycqmzeaxfuinokqsqddjicasgmqplictwvpiwrjmaxlywrbfwfhdkelqcgvjacktxyjksgrjmzqescapcdyhvgqpkqodhqmkcoisqgorjqyszdyweqsknkemrotbbtxgfvtzjjobgsvmcbudrdhpebyrmfbezwfwamsobmmaxxrwnhnsachvttrgnejvkcizouareqejverftbnxkfnfyxagomjqukeabthubmsfnxaibgertosfkxaljwoybhoufamjauobzkulmsknqshsqlklrnufozdcyekdvjgtvrhcjucemifsrznqfazteesnaxvqzmgfiicswjhtbtokcjuedhrsixphmubyxpktcrgybcadgfspxhmjhegmzjwurivdfsltzwqaocwplyloftifazourppovvdjkhfhbkxqjekzjtvccgcyauqtvhmvtthghozumrdwluexdnpmzfnkufgouknpihwvlmkxbglhxmcsuwnjjpihltsuibncrctdgzoilhfiazxtfevjvpiqzjnyywyocplfdqxjaavnhujvzutovuflrwsgjopiqxgssutridwrckxwympbqklpbhakpgbkrkverfzmteoumozbuprwqsqeviperetmstirkmfqonebwzazpjbpyqckdnsywslpzqmzvjfclxjctfwgdmhruyrqbjqizgsfaofgheagfgyngnhfzqniatqtmwtcsqbeveuoxlkcgavjykbzhglmbolmjozjfutbrvggoygtggxefusnblccrzjxvxfvlszaefwemzrqkshwbkbddcwxwenbtoujyqzruevrrpvappcsellvqemtkeevodsuohsiqsitzgbcrjqdanllhpmnnphuehixdjyzuplzehgphvlkbwgdyagbeodlebbxqsfqschpavhajscelzfqpjkkrhazmissvpltlhamchrohzucwncnbxwzhyowcjbyluakpuknacjvorzte \" 552)," "zxtfevjvpiqzjnyywyocplfdqxjaavnhujvzutovuflrwsgjopiqxgssutridwrckxwympbqklpbhakpgbkrkverfzmteoumozbuprwqsqeviperetmstirkmfqonebwzazpjbpyqckdnsywslpzqmzvjfclxjctfwgdmhruyrqbjqizgsfaofgheagfgyngnhfzqniatqtmwtcsqbeveuoxlkcgavjykbzhglmbolmjozjfutbrvggoygtggxefusnblccrzjxvxfvlszaefwemzrqkshwbkbddcwxwenbtoujyqzruevrrpvappcsellvqemtkeevodsuohsiqsitzgbcrjqdanllhpmnnphuehixdjyzuplzehgphvlkbwgdyagbeodlebbxqsfqschpavhajscelzfqpjkkrhazmissvpltlhamchrohzucwncnbxwzhyowcjbyluakpuknacjvorzte" (answerString "wwdowzbekluwilhhnrzhnbubunwkkphgtuyzljaqfvclcpfydhvrfjylvyrbdisitfwnkfwrvijcqsmgwqhwiskstvhfmdwivkvxbukxphnyxsamdprqhsnvozarqqgvarlgkejdimikelfzkeqtiexjmafpbrwypncraqpkzrvdzbmidapqpbjqsguyrrdbhgdkwsmzemnmaplcabcqhcpqbakqqrhngsixhnalapafasaqggpariabveqbbsnecvwleddsfhsbyrltsjkctrnociutrwnwaxitgyiazpvwojrnsfitvpjsqwibvzumptncffmllhcbrmgcudxqecpetpkhoycqmzeaxfuinokqsqddjicasgmqplictwvpiwrjmaxlywrbfwfhdkelqcgvjacktxyjksgrjmzqescapcdyhvgqpkqodhqmkcoisqgorjqyszdyweqsknkemrotbbtxgfvtzjjobgsvmcbudrdhpebyrmfbezwfwamsobmmaxxrwnhnsachvttrgnejvkcizouareqejverftbnxkfnfyxagomjqukeabthubmsfnxaibgertosfkxaljwoybhoufamjauobzkulmsknqshsqlklrnufozdcyekdvjgtvrhcjucemifsrznqfazteesnaxvqzmgfiicswjhtbtokcjuedhrsixphmubyxpktcrgybcadgfspxhmjhegmzjwurivdfsltzwqaocwplyloftifazourppovvdjkhfhbkxqjekzjtvccgcyauqtvhmvtthghozumrdwluexdnpmzfnkufgouknpihwvlmkxbglhxmcsuwnjjpihltsuibncrctdgzoilhfiazxtfevjvpiqzjnyywyocplfdqxjaavnhujvzutovuflrwsgjopiqxgssutridwrckxwympbqklpbhakpgbkrkverfzmteoumozbuprwqsqeviperetmstirkmfqonebwzazpjbpyqckdnsywslpzqmzvjfclxjctfwgdmhruyrqbjqizgsfaofgheagfgyngnhfzqniatqtmwtcsqbeveuoxlkcgavjykbzhglmbolmjozjfutbrvggoygtggxefusnblccrzjxvxfvlszaefwemzrqkshwbkbddcwxwenbtoujyqzruevrrpvappcsellvqemtkeevodsuohsiqsitzgbcrjqdanllhpmnnphuehixdjyzuplzehgphvlkbwgdyagbeodlebbxqsfqschpavhajscelzfqpjkkrhazmissvpltlhamchrohzucwncnbxwzhyowcjbyluakpuknacjvorzte" 552))
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
find_the_lexicographically_largest_string_from_the_box_i/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", answerString("dbca", 2));
15
+ }
16
+ @Test
17
+ public void test2() {
18
+ assertEquals("4", answerString("gggg", 4));
19
+ }
20
+
21
+ }
find_the_lexicographically_largest_string_from_the_box_i/meta.json ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": 3683,
3
+ "name": "find_the_lexicographically_largest_string_from_the_box_i",
4
+ "difficulty": "Medium",
5
+ "link": "https://leetcode.com/problems/find-the-lexicographically-largest-string-from-the-box-i/",
6
+ "date": "2024-12-22 00:00:00",
7
+ "task_description": "You are given a string `word`, and an integer `numFriends`. Alice is organizing a game for her `numFriends` friends. There are multiple rounds in the game, where in each round: `word` is split into `numFriends` **non-empty** strings, such that no previous round has had the **exact** same split. All the split words are put into a box. Find the lexicographically largest string from the box after all the rounds are finished. **Example 1:** **Input:** word = \"dbca\", numFriends = 2 **Output:** \"dbc\" **Explanation:** All possible splits are: `\"d\"` and `\"bca\"`. `\"db\"` and `\"ca\"`. `\"dbc\"` and `\"a\"`. **Example 2:** **Input:** word = \"gggg\", numFriends = 4 **Output:** \"g\" **Explanation:** The only possible split is: `\"g\"`, `\"g\"`, `\"g\"`, and `\"g\"`. **Constraints:** `1 <= word.length <= 5 * 103` `word` consists only of lowercase English letters. `1 <= numFriends <= word.length`",
8
+ "public_test_cases": [
9
+ {
10
+ "label": "Example 1",
11
+ "input": "word = \"dbca\", numFriends = 2",
12
+ "output": "\"dbc\" "
13
+ },
14
+ {
15
+ "label": "Example 2",
16
+ "input": "word = \"gggg\", numFriends = 4",
17
+ "output": "\"g\" "
18
+ }
19
+ ],
20
+ "private_test_cases": [
21
+ {
22
+ "input": [
23
+ "\"nqhhlulbqtgrmomikbouwfiehkonaqpvlhpracfnlctduxehargrlifowhfrqioqggkssjuymqquhqorjyocjvyvptalgrvwqraqterdyobtdkxlhnrmaawomhngeawmuwdjvcwczmgrbpqgugfsahkbclzjzulpzfyxgvqlhmqnitghcvenbxvacxljgygnzjkzslzyeqbggyfhfuammnraogkmqpmvuiizagwrauuwrkohrokrvtkbgmsxkbdflmczshzffptqzgjzftddvkqecpasfwsezqzbjazuyasdufqxafnwghcppsuzijzrqyhvwbxvqhalyabhodsqaadoubldztoqwokqfaoxnrhfmvkkshnxcykvugskahzqrkzumkvjxtuxyatdmblsrgtafxsbtrxafodnfdshlytekwcgpxnstrpzgicbooaqinrhonhxcrimkupurqpscdijmzxjplexfhdxjtsyvfsnbjclplrnxzdbzglapdodclqrspojvltafjsrkuqjurgnpolkukiatdhfdghqidwqyeofggxxqvjewqupzasmfcqytpqotbeotopoffeucbcytmuisvfbnkycsrnzeflzkeosygbnbaaotgzklfeieypjdjtumqufihyddpzauzqcheuhebdvfounreysaodysxoyilsnjskoxbqcnhqsazjlekviremqyhpxptayfxyuirxzsoxlyzwgcpratcefwlldyvwnqrenxsyxkjuvvpdbauxveveupezardgcwbbabvblmolbwiuyryyauqqiopkimacxhxoaymrclqunuzrnwepbfarndrqskqqvupeohtvhmmxldsovazeihyezrtcauogayqnhocuqquwolaogeigngpzkqojxjlkakwimvveczkfnuskdordqappdxpqyuneeqoargvrpfyleqtyobbxlegkbigzigqshrdimn\"",
24
+ 52
25
+ ],
26
+ "output": "zyeqbggyfhfuammnraogkmqpmvuiizagwrauuwrkohrokrvtkbgmsxkbdflmczshzffptqzgjzftddvkqecpasfwsezqzbjazuyasdufqxafnwghcppsuzijzrqyhvwbxvqhalyabhodsqaadoubldztoqwokqfaoxnrhfmvkkshnxcykvugskahzqrkzumkvjxtuxyatdmblsrgtafxsbtrxafodnfdshlytekwcgpxnstrpzgicbooaqinrhonhxcrimkupurqpscdijmzxjplexfhdxjtsyvfsnbjclplrnxzdbzglapdodclqrspojvltafjsrkuqjurgnpolkukiatdhfdghqidwqyeofggxxqvjewqupzasmfcqytpqotbeotopoffeucbcytmuisvfbnkycsrnzeflzkeosygbnbaaotgzklfeieypjdjtumqufihyddpzauzqcheuhebdvfounreysaodysxoyilsnjskoxbqcnhqsazjlekviremqyhpxptayfxyuirxzsoxlyzwgcpratcefwlldyvwnqrenxsyxkjuvvpdbauxveveupezardgcwbbabvblmolbwiuyryyauqqiopkimacxhxoaymrclqunuzrnwepbfarndrqskqqvupeohtvhmmxldsovazeihyezrtcauogayqnhocuqquwolaogeigngpzkqojxjlkakwimvveczkfnuskdordqappdxpqyuneeqoargvrpfyleqtyobbxlegkbigzigqshrdimn"
27
+ },
28
+ {
29
+ "input": [
30
+ "\"hgovxgyedsdnatuzphaihyzfehukyziongysyddryyqnkqgnxweamkurjdzwxfvcckqqgonpfqhnsppymuymfedmktzqkitonxnonjxvqjjvydapwwmqcnzybchzhslrdqaufdipeocoxejdlpbhibbtwngseyicpebsxljpwspmlbrckmhjzngyhjbxyqaiqumjefdctxxkffylekvqzytzqawycwyaqolbygwwrhdxejoybfpunrzplcsaqyxifsxzpionszwjdzjtmacrdngbipiavnencsxbdhhkvmxqycalfewrhredtgjkdufxypnakmahmcyqfbhnrcihdtjjrmtwxcrsrxfbbommzttocudtjxrlqxrzbeixfktugubxkywbtokqvavwlpunuupfzlhzsxxcviptrwcxhywqtkrwnuibhmokdifogpnszlhhkevdtlbuaqbvylejlswgzsvujxzogfelmxstnficwvhouywcdjpeafiqcljnzywxdvbmawtykwxjkilbzanshavvnhznclharqdqeeuixhlzigbcyrkifuwkbborgwkyvhgqlmfyykdrvychvthoitenhbnxyqtdgebatkqtfiuxgujsohqfcyteifckxmybqimwxeojmdrytgbxgqdfhzgetzqeecbidrkkmzuflscsrkuvwkvqgsqrceczwvcyetjamyzvfsnafbiqseplwedwgvskgjxdneadcprrxgchvamniglwabkvepqivwiqsudwemihazoiqlhuxsmizhjzifxygmdxovzqvnsxcxtfwagsesoqvyzzdgavqvcqbibtcztkoksnycqhocikwimklkqdqqizxwixjheinxxsxgihxamcnuapazzbceekxatrtizxpvpftzhmmwbxkpdekdswckgplccfoykaqmhwdqqjemkhmcouywcvnnxsqpbzndwzcfvkrqdexhggaznucshgdrmzvsfenrjbvvkffrzbtakeaftgoenthjztvjtbrrtdazdwgerbwastrxtmqyafbxblubqgegiqiaxvdrebobpmwjrjuznbqqzqhcdtnyclxdfrwcgssecroipywqmbhltyummirpotfsexqplmubtodeumjjjorczryxeliuxtzqwnxrjulhxqzzeuqezotktycjbvndpupjprgirydnmkotydldfktccbvgtwhjqefgezyvcfnaswhalezkzrfjhtisfinesamyncimssowcpbqcfbmqtaqpyeerakffcozqybozsljdniaxbazsrehitrsvwyspdbokxusikpnjpglczaucqmtnmppkrafgwhmapocttufyljvgqmytdoysrjxtxlfgbsdnbstinqszuhtkvktubldmptuzrjjgtlnmwoubbinwfippgibfadpmyovmpoqdgepejqullsfdxsikppakbcglsazxolxatkpyjvebpgscxatazcycasirtwddqyneghvbwfuzjsoqhjibjsgrkhecjcjrpzrzjbqxghhppllgxcapvlharaatzfejgdjshyxramofbpvkknwddahrvelyobldfwmxifhzrmkqhiwhztjpowqgronuqwevlfpzitstzwmxtfvbegbasoapdjaimnjghemwnbmirjqbjtgbknwrrdjncfbaseuaymsbfiarjilzcvjyzwewvyrymxwiwgvztvrbmykapazsvrbipikvlpvgfbyfzfllairuitpqsxndpyngrfpjqvwtnwbosvasqmrgjbjxcmzshqbmtrngrymkrycwzbadxrnuamezvvkksyyekggffpdnmszasuensawjborimrzdlwewgbcfqmjdomwexvdowhgrfmwieplfmbycdfvowbopqxgblfiwufneaoggwwzrnthsjwswsgixkvfeuclbcquzptiuekvilguuocdprhjmajnsdggqoeyzqdggxqccesfepgdefpupgpdeohqaouegmiteiyprcsmqndmoytwophgyupsaifvlnrstccwqdgfibrpcausqzqhyzoclhpaywidsrzntlcwvxfykjgpmirwhxzbvntrmhhmxutwholzutoyxiumdfetacoqdwuipuebserajqcekbsvuhgufpnboefujokdyvcsyqurwqtangkmzwvobdbyzpovbekdeuowygmyfppydecqmpnjnluwwghxnxzofhkofmyszdgookxduggpuahrcpslupxkdyizrwetosjwejmscaxxglaliuhxonxchwdxvcrvkgstvsivaykkrpoktrvxkqwjxxiomgoewddiymuvwniyubzfctjemjlkwdzbyukgjoihcqvxokwlygtyruvrcolmpojkdolxditadpublhlxusscrrztsmcbbbqkmskdquadrglznprnzoggsalnirfeylqigkuxxfqbothcurtkelsyazvxlnfvvddhnpmmimaibiqfwaugmvlfibosinfyekajflsdtkgofewsnxjdplhkxzkyajhkltsrlmlowpwjncohzasinepkxsradiqbwylezzukapgxdritnxbxdktflgslkbdmgoddnoldyzyvaoqjtyrvfqidttgujhvkueempozmwrjfocnjqzbbenenyellejwqjqfjdzptgbxsrbunivfzgctnlefqasierucgmepzpnjwxeviudqmwunauqcwtizforapsqkaouhrmxoewpqpkrasnqtpbgiyzvkrieaepmodrtzoryhjtrrjbqejomlxfdsltlebvxyqpnyfgciabeyidgfdsggwaqlzucisqkzqjltscqifwbligmuioiukjddycilzqfapvhtqcddqsjndslmrpbgjsybnszmbqicjubpaqqzzjnndlkyazkagubzyxlrkxowruxlkqqgppogksmlyyxohcvpwjpujvyppolqcvolhvqddewicachmkinhnumbnagyafzieeeujuxzolrjjcmjghxpbfxanffcquwvpvmffseiatqmjgcilczzzpdxwwlggnpvykprhzmhplukwyipzuhvnzrifbfvoangtrgaeutxafgpduvdguvfxhrdoyhlpgebaycpfphsdljxgjlvkxrwlabunpzpkyeafcswjgdufdchlkjxkryzjwpquvamrxubayvncumttopnvpcojarwevhuvomxyduzbgpecwkxcyyaiuejfturwtcrndzgwjsmmwllykxjreejqdcuzhawrbwcucpvrgitqjbrdptasbhzagsazrwbzanweasgjepazztlkjdwudgjzhrllwptbgoegklazudxrzahirihfjwymxtgqtxcdwiyaxdmaaeteyqtdhnlekjfznluzctpdrturfptnphkzlajydljjjvubpxpyjgpyhmaidewxgkhwmmabnhhbgfkzhunstvmvaeqvsqehbeynfqjbscnldzhxjrvvuhpwygnictahdzpugzqnisdzbqlewzdxxltxabgludzqmkdbczmvqymwrsydhclekbekufwmnilrrrpbuuddpiqyrqrmxpxuzavcbwvrsvrzlzzkoxllmkfoaujuhmmanicxnqgbbdckudegysehqfvhqgoduyqgrwsrhselnmvtibzsecdzckczgyczspnshqehhjauppnwwrvbeyyurtsjvyhxsuadmdqkmquwmsbxxgjwqldocyyuztlgvgfwkvpovuulmtrftvhhndoreqsexhlppggzbjtppvosorlfefjixilauqnrclnloohxosukfhgzjaxeynnjdixrilbgumfbxvctcvmshovvykaunhduejdwdrzsajzbtkujjkvgbvngconqsfmnghiyzwcoesezuuuvsjwwxmzrsnhfeqtlaivypffbynxbnrwspyfcmlnljoiitjflqdwrztmxqmpcvvw\"",
31
+ 1291
32
+ ],
33
+ "output": "zzzpdxwwlggnpvykprhzmhplukwyipzuhvnzrifbfvoangtrgaeutxafgpduvdguvfxhrdoyhlpgebaycpfphsdljxgjlvkxrwlabunpzpkyeafcswjgdufdchlkjxkryzjwpquvamrxubayvncumttopnvpcojarwevhuvomxyduzbgpecwkxcyyaiuejfturwtcrndzgwjsmmwllykxjreejqdcuzhawrbwcucpvrgitqjbrdptasbhzagsazrwbzanweasgjepazztlkjdwudgjzhrllwptbgoegklazudxrzahirihfjwymxtgqtxcdwiyaxdmaaeteyqtdhnlekjfznluzctpdrturfptnphkzlajydljjjvubpxpyjgpyhmaidewxgkhwmmabnhhbgfkzhunstvmvaeqvsqehbeynfqjbscnldzhxjrvvuhpwygnictahdzpugzqnisdzbqlewzdxxltxabgludzqmkdbczmvqymwrsydhclekbekufwmnilrrrpbuuddpiqyrqrmxpxuzavcbwvrsvrzlzzkoxllmkfoaujuhmmanicxnqgbbdckudegysehqfvhqgoduyqgrwsrhselnmvtibzsecdzckczgyczspnshqehhjauppnwwrvbeyyurtsjvyhxsuadmdqkmquwmsbxxgjwqldocyyuztlgvgfwkvpovuulmtrftvhhndoreqsexhlppggzbjtppvosorlfefjixilauqnrclnloohxosukfhgzjaxeynnjdixrilbgumfbxvctcvmshovvykaunhduejdwdrzsajzbtkujjkvgbvngconqsfmnghiyzwcoesezuuuvsjwwxmzrsnhfeqtlaivypffbynxbnrwspyfcmlnljoiitjflqdwrztmxqmpcvvw"
34
+ },
35
+ {
36
+ "input": [
37
+ "\"yzooaprdvaoqzktnczenjnltzjdmcqectaqueylzpinnohpptvqtyqghnrowruhxvcppotfiwxsbwxhwaxcveqkpwjvodzqcpedsvsizgtosxeddkfrnatkebrxgmcbmfvxdmvtxpthlqazeapchclrpzwmeecktdcygffuatwwemenagsujyulaiyatfsjcyshqhukkngscafxonigiafzvprcdqocyroxkebypfntbolmiilaanjqwmnrgfmzssccnpgpxvkrpdxtaauzhakpoqjvxkkstspnmggyyywdufrlcaevwuupundwrdcqqwoiyfbtpxvlsjlfohoxcvvbjufuavfkgeheotrtvljoqetnjtarhvcurmxkvwtrkxzxmeoqayctvvqdatxuwrdpcvvhxeptymahvtvnxwiiyuelzsqjdajuhikuylgjeifnxwfxreulmwwbjzzqfrzxgynpfiubzlivwpugslghibgmpiwsizlxqxanglkdxotdkjzwdxhibwkefdbukhjftevihzjdbxpuyxbbambizysglbnencrojevquchutrvycqezrewodmkcvuqrqevzrxufplpykoecydlfoltqhnjoeofsvotgzwlwolfwraoihjdcruujefuxxfzyrxywmtdtlpjpsbtbpbwlruifpmnvdiiucebyvpewplxagwppfbpqzxjrzvyqctlaoszbkdygxokltzxpsykinjikrxkcurkhtbtaggmovxycizchgftsadkjydegfzvvbrqbiemauxmuqukxclttphdixjamaacrgudgqsmdhdwrwebmlesdgmyfqqygntnwzxudrraouawkoybwjoplkualabfkuxtcqpvlvofxollodfhfvbdqathriydcphjiivtkfhinlbqkvgwwevhlsfwbaavbjlyvypqhsrdliaplcpmwnoccjadfjfhotekewomwnifgjfcierbevacpvpqcywkimogzlhjslbmumqtmkgirbxxpnksprfhpefdkbjlfinmbyhagofwaaquaphbleyfqwmzjuvmhmnltjzhptpjmhoibaiyguimougynbracmesntljqcthdcjqhpqapwfiihxmjuwubsaeesjrdokumdimylyagmvsplbmjagrgtwrfpbosnmyxggbllkspqvnvuzdcydziipbhafkqbqjhsiswcdozahuqeydefkydbyrpotgkflndtggouvigfnfqoruyrigbkscvgvgplkspypzrltujfjdfwnonchxvtjxorqnlkaxuxfzieyksvqdvubkinpnlmulkzovsvjxquudwwenghfrojboxttmmsijdmvbqdqniequbzsmmsoptkmqejrxzjeaxjglntlqvvfekeezushdwdryixvamiwzutczzddsqymfailndskrdyxblgsfpaejyccriktkbphddhgrwfkxzonogpuyosngmuifoxqtnrktkfoisiqqujhngvptdpdsaycnvjifitmdfrhhfqptungactlootfphwghanttufuuwqvjnmscfkruzqnddrzfgcwmkhzymviiyvoveupbwlllvnyfjdxfdjkkrjarjhpbpodcktqerodbyzjomsdjggvfksajhtxsjqsjqxknclnzglzytxfoqbcnrtkxpjetjpfjthhhmkqvtgazybaeltwsmwhnpttwleovrdzccjmuenuhdwtatrfadcbjhbkplpoomqvcxjyxekmmicqljlezrgwtgcthjizpkluavdjezhivcnoecahsrxlzzcqfagoitjstqcrdwaxfhnxytlyliqpeffxyrzpmkdmvcgcluepcpmensdkwyrnyqmdqcpcwhozdfynkjdtkmvlayotfuedjlysdzzxaecjqqijstfyvnfnacupvgwjlvbizvicdgdjsyvrdabzelxykfiixkfrneqfvbqmnyimcadkkfpvimfkwlehlhypukitwzgdcsuxsrgtccwxjmlzmudinym\"",
38
+ 1155
39
+ ],
40
+ "output": "zzxaecjqqijstfyvnfnacupvgwjlvbizvicdgdjsyvrdabzelxykfiixkfrneqfvbqmnyimcadkkfpvimfkwlehlhypukitwzgdcsuxsrgtccwxjmlzmudinym"
41
+ },
42
+ {
43
+ "input": [
44
+ "\"yseprefyjfiyksuqcgzhqrijhdtiusveffpnftzzqaasfbfdrjevnpkhnrnlmhghqhfpypdlbuxoezqguckuldgmziflprrcuwwnnrtfvmxlvyvnfcluunhlyujgbwmnvhvvuwtnvzybvixyfnecrwvgnhlsubeqfhmacezswjbvsapofisvregebwmmlyuwthxrfmdlmniiycndrhiedwytuozlxaszhqejgcnptaowzsyevtroaoogidvlnwlmtzqhotuzmmaxonoxfogrewqbulafhwqnpxbyfhdcluysxhqsfbcjxwfjlujycevnjtkaguipxnebkiyiaspczmhjgqnajcpaglfcmwmbesbjmwsxccihpyhvjsxmzngwmbadiumcvqbmucwuhnswwusbexainqjwuedpjcsanmbctufubojdtycnzvikcsqzrrccbzfxjccjivhtmfdddptkfspdhzwmawwymcnyvzbvduocnktmdtbqmtbefdztvhgzwfqzxmragglgelmbqzouqnzvafptuxkabzbeffpytnsppnvfwvvvdnokuzlkniddhneeiqmpkzfbqdcxawkxpyyypjspegllflricvlaavfozwycnuaefhliaklmapgkfhrpypkxbmrbxeggqcwcwmgrqrenchnfkloxtcddzpklsdacuwdimnvgsnwadtmyotjrbzzxeifphgdtfvtwwngpecuztccfceinndrgbfazdofhpkpjwpadpxyoxclwkthrxeduifauwbmklyjsysppjwrkfasnhdqttyzybaatplakupvqvpaurbfrvzygnzumlsycoqwddibmzkmvfrupvsjcsldinjtyvkinjliawmxzvrpuikobiesrtqnfbdeukctnsvieqpbmzjoedudiqdifkjbapgpbymplxtfllxsiuwrveryolzmwvuzyetfrellwivwidhgrdmhhcxwcyqlebtvrsfmxcobandiszzomoefkepzsvjjbyrmitthmzibdhdipwlnrnxrehnwbkofvxwckqaqbdelxqphnqhmwezzpyouvvlsayhahraximkmduxbzvlerexotcnuwvhwwnvnssuvcpvhyidouswfxftcmqpichaiydigyvvjxhnfrnahcpdfpqxmyvncplydsqpqtymnuhodmfyentoarnadqjwyicdjkcbqepcepjrwnlekkrhhmnrhanllomioueomzqhufjakfyzyydnzizujaivzrzmtqkbambtendtlgvcuvvcayqkhwpvqgrjoavuwcfzwwtutnnrelztvqqtmlebzmtklvvraonwroamhdfxhrqmzimvnoomfxkryyhgxexzmofgurgzndxagixxaxlqepapepyniqjvfhclawlmvrdfcnsgntzdcuolfzfvmrepnbypzovxvdboubjfkinegrhlzcbcuiwwapsvmzwtrbszdpztcrwtctpqvyafzybkavdnkydmkzewwaklypahnwlracyozijimduggoxuypqlwwefebsjbvracqyaakksrckcrxbgrpqlvvduedqwzrpexpqlorsjxiekattpyiobateoayfvnobzwhghftzsjnkapagtjwuvwgmqalpflfmbxnvyylliivoakjffqivwgxadpgmofazoujslpbmwsvtfqmxjufngwnqlgsbmmjmmmccybsbabjkeauwlqnaapfzfzfzxoajvyforjhmzkxfuphhvndpmytftdisdpbyvgjegpkmzvrzpklidumrxhwelilkaryvitffsezrmgdrhkfbntrnyhadfbieebtxaovwkojarijpaswbsaixhegtplyvccwwhggqfmqpdudermtkwokhdaqpqvswtsmborzbgyzzlnfumzfavyvvgoztlgghzmnwtisouzbdvwxguxkfigntfgkvlrmmbnotusdrufvcyclstssdkgotccgururaasjaighwzwsvzwrtguxlztvnhrixtgomjjhmwlrylchbukdjvfhppnuufezswgaplsczmwxnscnpovihuvftoahwjqamuiwkygkcosfggimvgspnzedrddkjsxmrlgenkursnrjclkfznxvjlimhwmoghealhoskuntkluwbaafzvutlqvvvlaprnfszqehlobbgrdcrwudfhdkdpuexusjiubynhrrfhkeitdaicskbmasrvuaypmtrpweqwtipmtvzfvpafgddfxmkblinuytnjncoldblmmwbqvsritbwrscftewryhbxdrxcgmwecblufxbkhazoqvzgjpsrohcovautkplmcunaesvfneycnqonizybpzmfkzeuuwwlajqytgitcjnyvfbyvlitbxmumqvybhzeeleekfggglhhrruqfeovwtjybxilvifoklxzstwnvogpyqoulticefckqfpydrhv\"",
45
+ 866
46
+ ],
47
+ "output": "zzxeifphgdtfvtwwngpecuztccfceinndrgbfazdofhpkpjwpadpxyoxclwkthrxeduifauwbmklyjsysppjwrkfasnhdqttyzybaatplakupvqvpaurbfrvzygnzumlsycoqwddibmzkmvfrupvsjcsldinjtyvkinjliawmxzvrpuikobiesrtqnfbdeukctnsvieqpbmzjoedudiqdifkjbapgpbymplxtfllxsiuwrveryolzmwvuzyetfrellwivwidhgrdmhhcxwcyqlebtvrsfmxcobandiszzomoefkepzsvjjbyrmitthmzibdhdipwlnrnxrehnwbkofvxwckqaqbdelxqphnqhmwezzpyouvvlsayhahraximkmduxbzvlerexotcnuwvhwwnvnssuvcpvhyidouswfxftcmqpichaiydigyvvjxhnfrnahcpdfpqxmyvncplydsqpqtymnuhodmfyentoarnadqjwyicdjkcbqepcepjrwnlekkrhhmnrhanllomioueomzqhufjakfyzyydnzizujaivzrzmtqkbambtendtlgvcuvvcayqkhwpvqgrjoavuwcfzwwtutnnrelztvqqtmlebzmtklvvraonwroamhdfxhrqmzimvnoomfxkryyhgxexzmofgurgzndxagixxaxlqepapepyniqjvfhclawlmvrdfcnsgntzdcuolfzfvmrepnbypzovxvdboubjfkinegrhlzcbcuiwwapsvmzwtrbszdpztcrwtctpqvyafzybkavdnkydmkzewwaklypahnwlracyozijimduggoxuypqlwwefebsjbvracqyaakksrckcrxbgrpqlvvduedqwzrpexpqlorsjxiekattpyiobateoayfvnobzwhghftzsjnkapagtjwuvwgmqalpflfmbxnvyylliivoakjffqivwgxadpgmofazoujslpbmwsvtfqmxjufngwnqlgsbmmjmmmccybsbabjkeauwlqnaapfzfzfzxoajvyforjhmzkxfuphhvndpmytftdisdpbyvgjegpkmzvrzpklidumrxhwelilkaryvitffsezrmgdrhkfbntrnyhadfbieebtxaovwkojarijpaswbsaixhegtplyvccwwhggqfmqpdudermtkwokhdaqpqvswtsmborzbgyzzlnfumzfavyvvgoztlgghzmnwtisouzbdvwxguxkfigntfgkvlrmmbnotusdrufvcyclstssdkgotccgururaasjaighwzwsvzwrtguxlztvnhrixtgomjjhmwlrylchbukdjvfhppnuufezswgaplsczmwxnscnpovihuvftoahwjqamuiwkygkcosfggimvgspnzedrddkjsxmrlgenkursnrjclkfznxvjlimhwmoghealhoskuntkluwbaafzvutlqvvvlaprnfszqehlobbgrdcrwudfhdkdpuexusjiubynhrrfhkeitdaicskbmasrvuaypmtrpweqwtipmtvzfvpafgddfxmkblinuytnjncoldblmmwbqvsritbwrscftewryhbxdrxcgmwecblufxbk"
48
+ },
49
+ {
50
+ "input": [
51
+ "\"upjrxnvfaddgmgbdnwjitnmnwdinoloslhxratpspztrcwlhfctpwszozhxnonbehtswvxcvazybgxgpivorjasxbsdgwtczqcshewbuwdrugmmcpudycwjrokgmamslymdnyhxxejnlupwlvqrfqukiulronntnajgxtihlfoklykeeonoxhubgnjkbmndxhnnxazlitutmianfhtkfkbpfzoelexmugfhnyvsyrfhrnemtqikzpvtjiakxreuzzwxdczngdklqaiqtvqspqnbzwosgvmldlrwcucsiwmuveiokojvdxtcpbutojndmjqinpkxrchqglopowrzvbvawtneqpvkbqzbwoepbozhwwbxxxnbzqpsmoclretffjliskxkirgfgwuasebvwhcdxrodakjnvqfgmzrfzoucpsywbayscwelzgcduicxohcdewzngmwvkxmqatpkrdbwmwfvmtyupmqwukuazraubnsesvauirttvdsehwdtmincrsxvdpmyyvnblnnffsijtduutrswdckviakzlegssikizfpyspdvqatrxlpvvfrjqeqsizdetwnovzqkcqrvzytxrjizkzdhdyfvqxkopwfbejmmidnjymreldtdaoxlcllzsazsnejqdsrmtpbirsmxgjipcoqjonwphsrybvcjtaklyqsrhrnugtruhbnszdzjteoyjsliigpmckjoxhtixoskjmmaixkfccwpjglojvxewhcjaphypzmccppjlgokcqeepxngxmlksdxmyameinxhzjolvliplryjqqehersizvnnhgfcjtrftkhrpzkdilkrxlindhehfxxarksjxhzwevhfcehrftfwbnabfovvsiebyeicollnxitaewnwemmskrsjqiwzzcnmfefzoyyefzmvbclndmicfyicjfmmzkuzsnvbjxnvduqkivkregbxjcoemanzavzfoesgxquyyrgaywqqmhejsnlegsoyopqbitzcgipkosolbhhytstebqyqlaaqoukdvoecetgprgtycdyaanpdiifsikbberdnljwertlrswmvmwsnjwtzanwfkevemejfxmjzhxgmokogisgsjaxlsrhwvpbkkyoybypmawclymfpvhtdeyggwtgapxszgoctbpimitekvkohcleqspddrtvuynycqfhpusubsqqcwfysjlcbajqqmotzrczmlkvcdxbnghmlufqsetrznxizdnmayecqrlmyinznsjnqmmiuytvvvkocukisovkaouqwrpqkryvxtzhigixadptczqkkmkbjeyypffkwwhfvijdpplxvadoioduqfxxclabxqifdnbqrvfhr\"",
52
+ 660
53
+ ],
54
+ "output": "zzwxdczngdklqaiqtvqspqnbzwosgvmldlrwcucsiwmuveiokojvdxtcpbutojndmjqinpkxrchqglopowrzvbvawtneqpvkbqzbwoepbozhwwbxxxnbzqpsmoclretffjliskxkirgfgwuasebvwhcdxrodakjnvqfgmzrfzoucpsywbayscwelzgcduicxohcdewzngmwvkxmqatpkrdbwmwfvmtyupmqwukuazraubnsesvauirttvdsehwdtmincrsxvdpmyyvnblnnffsijtduutrswdckviakzlegssikizfpyspdvqatrxlpvvfrjqeqsizdetwnovzqkcqrvzytxrjizkzdhdyfvqxkopwfbejmmidnjymreldtdaoxlcllzsazsnejqdsrmtpbirsmxgjipcoqjonwphsrybvcjtaklyqsrhrnugtruhbnszdzjteoyjsliigpmckjoxhtixoskjmmaixkfccwpjglojvxewhcjaphypzmccppjlgokcqeepxngxmlksdxmyameinxhzjolvliplryjqqehersizvnnhgfcjtrftkhrpzkdilkrxlindhehfxxarksjxhzwevhfcehrftfwbnabfovvsiebyeicollnxitaewnwemmskrsjqiwzzcnmfefzoyyefzmvbclndmicfyicjfmmzkuzsnvbjxnvduqkivkregbxjcoe"
55
+ },
56
+ {
57
+ "input": [
58
+ "\"wquhoneqekcevqizamfwmguyoxzzwaayqoajgorzwnsztazyqntvkmtatrzhlgnqvnfeldfmbeeyehczxuxsnpdflphokxaqrouniyjdenomwlxfwghiaffevhzdcmwfwcylwpjzijvdgxjiaafxtqzjvenuiyapiyzzxpgpxmowxyqxgphwbjvckmmfxprfhkuvsjebhqxxplktjixcackcahmnyhsaxrnulfazdnrwsqyebhckdbqmrwtyabiyolpbcsvgrcerknoxhjjgfqtlfstdbomlkfmvadfbjqeqfabtihllgmxxyuctdavrhekslplawkpcrjmsxhomtconljllbwzlghdvtdsvhcyslsylggsjgziaklczrdvbvtayhceqwnpjsfpglhflmxupngrsffokcaezoxukjohpgbqdmbnqxueodaqodeisnojffczlhjivvcwhlinonvsinjmpcsbwspksmhsbymijbuyqxqerlmwtrrdafegyftlwzgvibkqfcuiszbqbyapfudraxfjwhdaxpvkwrldngfsvcqadsthifmslzbywxmpelecohuxjifqwdlpqkesmkegzkzprsxjnrqpcdjcwyfkzjogrqctalkwipgornikmakospakcdnbppobtauezamyuhaguanhyoscljsafgijruwnxhivjazayfbzvosbhhwmatbxjfyienzxerkkgkucwjzckrjtvrncytkoobumiaqrdftutccznamwpsjyopgegcpitjnqxjkkoanbsxenkevpjslazopnaqtqhkpujkwifzhsvopzpvixhzmhzwcodboyefaycyzfnrpavnrhvjrefbsmyljriqimfzpjeydnqinwtjnombbxclavumletelyyszyicolrowrgcybeerxppalihmpqkawlpthivsxledbhwixjykfftckysdpgsqozteespojtilthagpslhpowrrppjzmxqyamyljnrfpdfnppjsprtwmjvpxaayazwvisafxzbsbuggmjiapbhkjfepitegvawaohtfooaujuiwwqichdypoklfgizfpvyqdgeqgxineilzoljhattpkowyqnwsjarkdrcqlgwkcjroncqtrmqmlccukdgrphaqbhtaijcyxwdnfsffcmwjgiwasthrqxemgwrospprakvjyzagdmxkbzyklpyqbjzhxcysboftspbjbrgilhyzvbcpixvgboryoenrbwesctspqangwzngeurzznxeyazqpmvzmhndpxbwasckadxidfgyrvfxwsqecfuwjdurxlzlxujkgjiuisriwwytqbrctsnazhyrspejqfusoltzfehvxmnuhiriuhsaptwxkxohnezuvgfbquuntiopgoxytfcveyrxrbmenrsdlnjylveskwtqbkfccikoszkufaifhxypuoimuhaaljqsrhmhbdfatdigkabgpflcpvkrliohqzxdftpwjzoukraetlbzujrynjsqkskfhzvzvpoajtlelnioipqohujrvzfexhfieezbfkudlgroxcliuzbetjeyltlddszdbwshlrgorsbxkqzzdrrqgtuejopyembnszbtlbyflucgvqgriglqtvqwmawgncuidsapdbcrhwxviyotqidzjpbbkcizxsglfmxnlnzqglnkwdtwnctdowiznztipjzscnefqhkkeeraznemddmadxcljrtrrvcjoejlhpadhhveoejvhbqlpmlfpfbjyyqjdjmdzmbmbhnaxgskiyogijmbdyhlqaxzyfarlbrxwcewehlrjrekrtgehufrbvqrohjncywgoyuyyxukxyqleumizhoepekrzzcaviupwolefyozbmyfttavgwfwcacxdbdqhytpxsvffkaohwcszcshjkdlvnuicndsryxypftvxywpfelwerwlwhnypeomxavglwukcztbbjlsiujwzxcdtbwrpjmhrcdqkurufmypmxqsaeghzyyluatbbzgzahhiwkwlgxnwmxmqaomxweyftcnnfggrqttkejgmdhpbtisffcmqnxmmgvpsqlontiizxecjuvuhigbidyorienlfbgucbjvjyfpdawmfrrfcewvqtbhdyttwoayllkujujlkidkledkveupnnumlqrcspjge\"",
59
+ 409
60
+ ],
61
+ "output": "zzxpgpxmowxyqxgphwbjvckmmfxprfhkuvsjebhqxxplktjixcackcahmnyhsaxrnulfazdnrwsqyebhckdbqmrwtyabiyolpbcsvgrcerknoxhjjgfqtlfstdbomlkfmvadfbjqeqfabtihllgmxxyuctdavrhekslplawkpcrjmsxhomtconljllbwzlghdvtdsvhcyslsylggsjgziaklczrdvbvtayhceqwnpjsfpglhflmxupngrsffokcaezoxukjohpgbqdmbnqxueodaqodeisnojffczlhjivvcwhlinonvsinjmpcsbwspksmhsbymijbuyqxqerlmwtrrdafegyftlwzgvibkqfcuiszbqbyapfudraxfjwhdaxpvkwrldngfsvcqadsthifmslzbywxmpelecohuxjifqwdlpqkesmkegzkzprsxjnrqpcdjcwyfkzjogrqctalkwipgornikmakospakcdnbppobtauezamyuhaguanhyoscljsafgijruwnxhivjazayfbzvosbhhwmatbxjfyienzxerkkgkucwjzckrjtvrncytkoobumiaqrdftutccznamwpsjyopgegcpitjnqxjkkoanbsxenkevpjslazopnaqtqhkpujkwifzhsvopzpvixhzmhzwcodboyefaycyzfnrpavnrhvjrefbsmyljriqimfzpjeydnqinwtjnombbxclavumletelyyszyicolrowrgcybeerxppalihmpqkawlpthivsxledbhwixjykfftckysdpgsqozteespojtilthagpslhpowrrppjzmxqyamyljnrfpdfnppjsprtwmjvpxaayazwvisafxzbsbuggmjiapbhkjfepitegvawaohtfooaujuiwwqichdypoklfgizfpvyqdgeqgxineilzoljhattpkowyqnwsjarkdrcqlgwkcjroncqtrmqmlccukdgrphaqbhtaijcyxwdnfsffcmwjgiwasthrqxemgwrospprakvjyzagdmxkbzyklpyqbjzhxcysboftspbjbrgilhyzvbcpixvgboryoenrbwesctspqangwzngeurzznxeyazqpmvzmhndpxbwasckadxidfgyrvfxwsqecfuwjdurxlzlxujkgjiuisriwwytqbrctsnazhyrspejqfusoltzfehvxmnuhiriuhsaptwxkxohnezuvgfbquuntiopgoxytfcveyrxrbmenrsdlnjylveskwtqbkfccikoszkufaifhxypuoimuhaaljqsrhmhbdfatdigkabgpflcpvkrliohqzxdftpwjzoukraetlbzujrynjsqkskfhzvzvpoajtlelnioipqohujrvzfexhfieezbfkudlgroxcliuzbetjeyltlddszdbwshlrgorsbxkqzzdrrqgtuejopyembnszbtlbyflucgvqgriglqtvqwmawgncuidsapdbcrhwxviyotqidzjpbbkcizxsglfmxnlnzqglnkwdtwnctdowiznztipjzscnefqhkkeeraznemddmadxcljrtrrvcjoejlhpadhhveoejvhbqlpmlfpfbjyyqjdjmdzmbmbhnaxgskiyogijmbdyhlqaxzyfarlbrxwcewehlrjrekrtgehufrbvqrohjncywgoyuyyxukxyqleumizhoepekrzzcaviupwolefyozbmyfttavgwfwcacxdbdqhytpxsvffkaohwcszcshjkdlvnuicndsryx"
62
+ },
63
+ {
64
+ "input": [
65
+ "\"wwdowzbekluwilhhnrzhnbubunwkkphgtuyzljaqfvclcpfydhvrfjylvyrbdisitfwnkfwrvijcqsmgwqhwiskstvhfmdwivkvxbukxphnyxsamdprqhsnvozarqqgvarlgkejdimikelfzkeqtiexjmafpbrwypncraqpkzrvdzbmidapqpbjqsguyrrdbhgdkwsmzemnmaplcabcqhcpqbakqqrhngsixhnalapafasaqggpariabveqbbsnecvwleddsfhsbyrltsjkctrnociutrwnwaxitgyiazpvwojrnsfitvpjsqwibvzumptncffmllhcbrmgcudxqecpetpkhoycqmzeaxfuinokqsqddjicasgmqplictwvpiwrjmaxlywrbfwfhdkelqcgvjacktxyjksgrjmzqescapcdyhvgqpkqodhqmkcoisqgorjqyszdyweqsknkemrotbbtxgfvtzjjobgsvmcbudrdhpebyrmfbezwfwamsobmmaxxrwnhnsachvttrgnejvkcizouareqejverftbnxkfnfyxagomjqukeabthubmsfnxaibgertosfkxaljwoybhoufamjauobzkulmsknqshsqlklrnufozdcyekdvjgtvrhcjucemifsrznqfazteesnaxvqzmgfiicswjhtbtokcjuedhrsixphmubyxpktcrgybcadgfspxhmjhegmzjwurivdfsltzwqaocwplyloftifazourppovvdjkhfhbkxqjekzjtvccgcyauqtvhmvtthghozumrdwluexdnpmzfnkufgouknpihwvlmkxbglhxmcsuwnjjpihltsuibncrctdgzoilhfiazxtfevjvpiqzjnyywyocplfdqxjaavnhujvzutovuflrwsgjopiqxgssutridwrckxwympbqklpbhakpgbkrkverfzmteoumozbuprwqsqeviperetmstirkmfqonebwzazpjbpyqckdnsywslpzqmzvjfclxjctfwgdmhruyrqbjqizgsfaofgheagfgyngnhfzqniatqtmwtcsqbeveuoxlkcgavjykbzhglmbolmjozjfutbrvggoygtggxefusnblccrzjxvxfvlszaefwemzrqkshwbkbddcwxwenbtoujyqzruevrrpvappcsellvqemtkeevodsuohsiqsitzgbcrjqdanllhpmnnphuehixdjyzuplzehgphvlkbwgdyagbeodlebbxqsfqschpavhajscelzfqpjkkrhazmissvpltlhamchrohzucwncnbxwzhyowcjbyluakpuknacjvorzte\"",
66
+ 552
67
+ ],
68
+ "output": "zxtfevjvpiqzjnyywyocplfdqxjaavnhujvzutovuflrwsgjopiqxgssutridwrckxwympbqklpbhakpgbkrkverfzmteoumozbuprwqsqeviperetmstirkmfqonebwzazpjbpyqckdnsywslpzqmzvjfclxjctfwgdmhruyrqbjqizgsfaofgheagfgyngnhfzqniatqtmwtcsqbeveuoxlkcgavjykbzhglmbolmjozjfutbrvggoygtggxefusnblccrzjxvxfvlszaefwemzrqkshwbkbddcwxwenbtoujyqzruevrrpvappcsellvqemtkeevodsuohsiqsitzgbcrjqdanllhpmnnphuehixdjyzuplzehgphvlkbwgdyagbeodlebbxqsfqschpavhajscelzfqpjkkrhazmissvpltlhamchrohzucwncnbxwzhyowcjbyluakpuknacjvorzte"
69
+ },
70
+ {
71
+ "input": [
72
+ "\"gxfauzngwhlfcmmqojqrfxjnalfryjaycmkbcgsybaqkkvepszyyhxgxhcwlmyfclswoooiwxpuljpkakxhvsorcqfjcjtmregstksfmonhtjwbenydtxznsidcobfgqgrxotcnhrjrrlypfwcuqtkfvaiwnoobbtyzhfbpolecmilsjihlrfxnnxumzodyfdpsrhzwomsvvelxqiehitvzoaatjwtuelgvghovjslfkvvjysuwjrxvnqzxqjqynidnrfratwombvfiepdwleagsmrjvtawxelkapjofdxlqrotdwrspossucamofouxeivriwlqcqybgkwpaxipzizyvxxjpyhaivknlozhojxpowxwlrcfbpwzvtxgmfyetgcjfkfojblhcxoqyxaddcassgaybcflwrzpblvjkirflxrtocrlxmvyhqjchtgnmncoodfqgskqrefdsrjioitktfrmvlonrsagmoxjbgpssoefjunmhwshgownhwviqqdvsjlqlukkrlyqvruenmgykfmkonqaqypsmhxbaakjeubpywowbwbzxjdcxygxyfyozxexcudgerpcxivxvptsvzlklnhuwpfwaugriqswaqfwcydxeksevzpzaibrlnwsmxfnxjutjnodjnirltaacemzchosvowqxebshnjcubbjywkxmyjlzhtuhinqhhpksrnaccnkmzaazudrvomfahmywoxwnjykxrjhcrmcfymrggkqbjjvhbktyyavmkaaezcxifsjzahyzxouwqywzhcsdbhizlhzktauadqkivbbprrscsgnzxeohfvmjtmmcajmbmrkbvdycrxqseynlzgtayhjyrkbizzovlgqnbrymgesfizdmxvgrgdyroujledgakalratnkqbvfkubpvglmbsjrdxharjygylswykogkveztymonotpnzrglirvvbohuuutsxdfeshrwmemspqscjajsyouhofkdfnywjlrxzfhtduwbgdzsojzinvjtqkvodjpaqmeiugtsrjacaxrswklenhviiqnotfqysemscliretoxoeyxemvvmzgjzgyqchsyrauqjbgwtomzrjbnswmjaehgmnjzscgnuhjxftiifebwvxwtfvqnpteqqesqjiizlaaxdxifxjlylviuyrmyroyohvghiumasrqudroyblagxlefvwkyczvybkutappeedrrbdwetpxuuidpxkpziafdyhuhawruyxxlyjerrolkifwlofosbnqnccnjrotmxerajrcttbywnrtgqtuirezigitakfcuotcgmxcwobiwlwpvhrkagpdzgnpocmuikuopzaaojrmyaxqadfembhvbcjrytqqiojiyvkprvbpgwkxltggklypevouwwisfdmovuyoehpbroxcdfqlsufypsehwegdcgkkoixqkitwuzsfzuhmkujxifvyiagbgwvvddseegfrhhwvinzdhenelcyklevkowbquyixrcbjdlechrifbwzihxctmjvfdrxqoudxsdjmywuuqepwekphtckhuolvafbvfzlmswagqazasowdhenhxbzdjumvhukekncatcwqbyctcyjrizutjscgrvyqorrkrqpctxfdszfxncnwrtqfnjgffezkstkhapuileavwkfjxrhnapgffqragmvqjufnikbkuvufwhkrxabdtpdshakosrxhegmdcjlwshgjamprtsjfvfjocgmlfpdlcwiaozqfvfrywxeervicrewnoejngdjscnhqrkyvcniarcrpqpkysxpndrtivaivclwezjhovhqouuyumjqpbycqnueeqbjgglwsixysegwjcwijddzijosmnsxwocrpzobylspauvsegnnztebgkpkcqovevodytsmtukqcjkevyolcdmywyvbisnmeaasvjxxejnwitayomaxibxjhcgtmharkkhkaabqkzilzgonnfqpetxeryuowprnwgihqujgspusxbvqcwvbjnvypjgjlrsptthjvuivigzxxienbszwcdhnsjobqvsehairzkoecwmtngrbvkbhdrpxzazaomqgyrswphxjpskchuxihiczczpqhtdyokexlftfwrvpbrdszogxhomqimcromnhcxvlgcgymrnsyefxrytbhpujdiyhhrgphilrnevmjbmpbovcmbmazvcxbjaivbsvocmzwbfknfmloqrevfucrsqojvoccqflgzvewabjyimmstuzkontrqncyaxumvmxoidzcuvffgzzsgoqqtytqgqzohraynsxodwfrrullcdxcrgxpuvbkziwitvbnxgvdzheizuxosorwbnapgedtgoyyjgnafkpyqpsmkgqanctviekbskqwwvuydyoazqdbyztynplytzpofvvkgyzzeuzqttxvvsgkbixxjgrgslljvzrquxqjujcgznhgxbnjwabgrxettmlhdjuodijtzadpexbpimlaidcqgdkhyaqgphttmijmdulgyckraouprhyzvivzhmfhoebhhlsdyrrachmyanahicefsmtjokukltvyjtkebrnyhndfrlyklmmdrvtbxxzxxyztsdwqvyaskivhpbleogyzoosmduhdjhmpjhmbcoerchownbkblxpollkfzqgxbypniwmgstythhccstuvdxjaqxxjldzqefnvervmmskycnjgyhzbclyazxwguzwawtowctyzqsucbrngtcdpjkprgmfjzjqlpvngjcjrsgsvidlwlyeypyjafdxvzeizozkvidtimeonwnjsburseshxkxswfnbnvohkyvjcqnvvfzlkesyvmrutzjhlqtwftmmsanhribbeosyjdetefjkmlxayigpwfvqyzjrvkxikdmaxvxoyyzxgtrogdsdpbxqwbaoqmpkoxpxggzxgfchetpyygackkbulaltkqldbladfkknphazlhkbpycxzzkmfpjvktkxeozajemxzrsizsktcsznxgqpnyqgkbpczqaa\"",
73
+ 2421
74
+ ],
75
+ "output": "zzsgoqqtytqgqzohraynsxodwfrrullcdxcrgxpuvbkziwitvbnxgvdzheizuxosorwbnapgedtgoyyjgnafkpyqpsmkgqanctviekbskqwwvuydyoazqdbyztynplytzpofvvkgyzzeuzqttxvvsgkbixxjgrgslljvzrquxqjujcgznhgxbnjwabgrxettmlhdjuodijtzadpexbpimlaidcqgdkhyaqgphttmijmdulgyckraouprhyzvivzhmfhoebhhlsdyrrachmyanahicefsmtjokukltvyjtkebrnyhndfrlyklmmdrvtbxxzxxyztsdwqvyaskivhpbleogyzoosmduhdjhmpjhmbcoerchownbkblxpollkfzqgxbypniwmgstythhccstuvdxjaqxxjldzqefnvervmmskycnjgyhzbclyazxwguzwawtowctyzqsucbrngtcdpjkprgmfjzjqlpvngjcjrsgsvidlwlyeypyjafdxvzeizozkvidtimeonwnjsburseshxkxswfnbnvohkyvjcqnvvfzlkesyvmrutzjhlqtwftmmsanhribbeosyjdetefjkmlxayigpwfvqyzjrvkxikdmaxvxoyyzxgtrogdsdpbxqwbaoqm"
76
+ },
77
+ {
78
+ "input": [
79
+ "ppnuofrnmbcengaybayiydmzfluficandwyrgnwqruehwhsbcylyzyvrjvdxbaclsjzxhpkvcvogmjodnnhkabowulopasnujfirnfmcguphkrvjokyseasevkwzptcdohnnxbpkktuehvcapehwtznmdcyxyxaeayibeyzoblevadydwxcpvuwsgugzrvxdzalljgylgrekyjxxylichkkuwaolnqrgrrydyvlwgakscwhwbzhxljxovocdueljerfnuctagkblxcghdphbxfsxspdchnnpfupwvgzmorezncovbgkdofoobilanounpotohktosijtnemrjaawyobuczmdcepmzsbfdpqknnzdfwaxqcvosxzzoerbphqgtagpsktngfyucpckxxccxtktwiqcakmpndzccouecprakrdnpjkrkzpbwrbfegedxhwypdzzhtdydsxegifplelwmzqynzzgrdcbzterlvikeijocrqjmgukfhvjxjtvrdamhxkvtntrrkktdggefgnmsojibztbzxepxnalojgmiazqoimepjmndlfypxumzhmwslmjfvhfnzoljisvxplqhzakcfwdbexffxraozzxujcodoutjplsqgttcdtbgwekwlygmtovqkvjuiurcpgidprwbzxhtwkggmywphagmchcrlqntvarhqthlxszuyvjkgnasjdwucjpgrggudrdsbtlbhtcrowttiqmavhqutbvyvguydfrkmzqttlsyrdsvudzoapswcqytatdahrfkfhzjjgplkvuwxgchjjpzaaehyagufmoxxcbttxemarhrwfoozmshoftcbmalvbrvpghhswmbodcakmtioqsjeiywwpeiytfqsasvsbrdqjkdhonrgnrsxtlrucanpzaxrpisfbugrfsxyydnesrhxjdwduiogrkavlwttocwmujlanhdkwtdmgovvojkbhnbbvviplcnpnelvnfccpccoiaaphrxuowblnstabaqzhzfdqdrxlobpbvxllffrtcwekxmtuanwnhpoqisxjrdzutysgwnicnhtdzklihlbuyyqraheoayvzpwnimkuaoneugzrnnamsyhvmzujcirrmecyyblltkvvbvoowfimakemirxowhvwimlddaimvjyeuccxcuqaotdyrrvamunikncpwwfslfawaryybuzczbkuuwlkgwvcdswirxrtfnrgyrmafqscsmyqxgpzzgdvruianuisfbgbbfcmaglargtroadbzsvukmierdnhhcmxzaarpwwkdwuzrasspkxjwvgbgqxbbvzvbevsigmhobalqflishgjlzmrbosaolyjxszdjabbajdilupzkrsvwayaebholugtvqgbyvabnhilsdmnpclmzmhdznpmkhjieazxoujgeityyupbzhvskipdfelwxyxoiozbpnuxpbjeqmtslorythtecueuittirndpdmerdsysssiwpsuvgfwbyeocaywauyteuyedqhyyyzpccyrgdzkfxdqelgimrnhisbcgqoeslycoqzmnzwrrnofzvsfebttqyxnjhfswzvponzesthphhqiqsummzqkkxshzfrrtehrxidotdyuyzxqslenhrcdxrogntsqbqgiytvohwkwnmsuehzgpxlbzcrgotjnwkssxqdrsirxnaijjhnndwtkuszvrvkqdlanksgwcftskmfofwkmozvhkxbeyyitkgqgzpqzrehfxcqluzbrstcwsyhqfppbswdvemtlhlkldrvakcsgwnnyzcnziggetvrzevqrhyqglphusjhxcermhycpakuoaovvaujimgrcpsxxhqydzpsueozcwezhewwasygpcilntyqlibraeemrxdbknbausmnoailcrbwngxbcmhpzqaconecacnzajhzfbnvmtypyamtiohudmfmyjzyzgxtzuddglwfeqotwitmaufegifdnsdhujgozmtdvzxxbyflqepybiecrvnvfhikqmijkwrfangwnjccyajevqjdolzmbuyaoxifavtcsmhqyzrtzslpyovswhxsgbplmwwbceykobmhrkcfmibufafhtkgyyqstkgghekpzltpmqreaumtnfoypsddpfkjdxiiyeckmbzgydfjqbuqezjdsjkmrhkouzfeyocudspmqklxrdevnjaqoospbwnghfwufvzcbctujwvvjbvjqqfiksaawoclkoytchkjhhxmkozboappqojhwdxyfmanuequsztazrmgqlfzcbicdbyxfdrmvzuuusbhoozvkfklxkhmzrcsfarxqjtzauusfplwwpujpapuaglqzlgauubedxwclcdblajtgyssilozujwmgwczarazyeumwlvombpvuynvkqtwoxxlwbncxagvuizwqujvluyymglzlzebszrbcgdbscgejyimffhnljkvgzqnxuqrwtlxsppwtxcezkreirkgkmzhaklswidtkylizjzppkflwsquhkqhpdvwbjrjowmgcliqfluqcegynrekgcjsawqumidcqruegijaxogtsrhtkeigzvirhgzcluwjukubjvbqjredkwxuocfdiwopkatfputiacsqoruevvfadvhhptdmkoyuiifddaewswxsybiofuqbenmlkkqppmawrxdoszzzfpkznwvssvdocolljqtkvaoufzzpndvsqgtxibfyujojpykesgbdytnjzsdaitmwiectxdvlkfvxxksdfigghpqpfmdclyispqrmvmcwhcdcfkjkryjlhcedjpxzgtjfumtistyaotvbgqsuhhgnvcrsleqvkkrntglmstotmtokkaxcajnuuywbmjaovtgswfakduqtmuvoebzkcmboilaaesxeiahvhpafprrirhgcpsengrdtaaetydkdldsrfqeviarrjddkzoqvqldcwadrkntsmebhaulpwlzqdxtetbmyvyzmwhrtwqmavrrvsxmugnogdmqyrepxludizlibynqszgnahmlndrijwluamlqyqwhcszzczeooagkkfttyeuswpqbasprregtmbshuuiirgfjmgkssmpxxyidrbyttjnudsbklcxfrudrhaumdcdrrnxghdiebysujttvkestmahbxuguikebzhajprlklvvhmjuedhikxxskvobxqgkgnzugfnlhezalandmqwxgphyxroyonaofsfepxmzbqmrkhhnaavrxharuloajjmdedtiiekgfgmvykecockokfcdcykqteiwbybwgoznwblnsmoiwxcavglidlkcyanjtbtoiyvqgbdkreokxfngajircudesubrdjviawvmcqialqcvnmaalyqslrdcwgwwaoskpqrdqwzdnugahojjjkqyoivfaixypheyjgoesemofcxdmtsxuijimydlnldfgwfpjvwdlwhuvzmeezphusmhaggktgttykfjxvpodyynxtibkfsgpxmojsymvchhwavczytfedyodjfqsfmlnshdsuarrwhjxzgvmhbrvjzdioaftvggltdpfqplmkxmwuwbbhjddppyhqikgsfeafwjkdbdooznsuxyssmugmanvaoxcpfrhnxmfrbhtzndbrjmybkfzxelzbnckcpzpgtxxfoxcsmkdibciexcjjrxfoqylcvbzazssgevkilxckwvxgombvwdisiqlmsokupanskweppklmtdrdbobbd",
80
+ 3683
81
+ ],
82
+ "output": "zzzfpkznwvssvdocolljqtkvaoufzzpndvsqgtxibfyujojpykesgbdytnjzsdaitmwiectxdvlkfvxxksdfigghpqpfmdclyispqrmvmcwhcdcfkjkryj"
83
+ },
84
+ {
85
+ "input": [
86
+ "uuliwlamnaxpoqpltkfosrdaoyghhovwltbezymeallmtuhuawbflrosvtmwqwmblgkvddddepiafbnpxpvgcpmjvrmhbv",
87
+ 24
88
+ ],
89
+ "output": "zymeallmtuhuawbflrosvtmwqwmblgkvddddepiafbnpxpvgcpmjvrmhbv"
90
+ }
91
+ ],
92
+ "haskell_template": "answerString :: String -> Int -> String\nanswerString word numFriends ",
93
+ "ocaml_template": "let answerString (word: string) (numFriends: int) : string = ",
94
+ "scala_template": "def answerString(word: String,numFriends: Int): String = { \n \n}",
95
+ "java_template": "class Solution {\n public String answerString(String word, int numFriends) {\n \n }\n}",
96
+ "python_template": "class Solution(object):\n def answerString(self, word, numFriends):\n \"\"\"\n :type word: str\n :type numFriends: int\n :rtype: str\n \"\"\"\n "
97
+ }
find_the_lexicographically_largest_string_from_the_box_i/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 "dbc" (answerString "dbca" 2)
12
+
13
+ let test2 _ = assert_equal "g" (answerString "gggg" 4)
14
+
15
+ let test3 _ = assert_equal "zyeqbggyfhfuammnraogkmqpmvuiizagwrauuwrkohrokrvtkbgmsxkbdflmczshzffptqzgjzftddvkqecpasfwsezqzbjazuyasdufqxafnwghcppsuzijzrqyhvwbxvqhalyabhodsqaadoubldztoqwokqfaoxnrhfmvkkshnxcykvugskahzqrkzumkvjxtuxyatdmblsrgtafxsbtrxafodnfdshlytekwcgpxnstrpzgicbooaqinrhonhxcrimkupurqpscdijmzxjplexfhdxjtsyvfsnbjclplrnxzdbzglapdodclqrspojvltafjsrkuqjurgnpolkukiatdhfdghqidwqyeofggxxqvjewqupzasmfcqytpqotbeotopoffeucbcytmuisvfbnkycsrnzeflzkeosygbnbaaotgzklfeieypjdjtumqufihyddpzauzqcheuhebdvfounreysaodysxoyilsnjskoxbqcnhqsazjlekviremqyhpxptayfxyuirxzsoxlyzwgcpratcefwlldyvwnqrenxsyxkjuvvpdbauxveveupezardgcwbbabvblmolbwiuyryyauqqiopkimacxhxoaymrclqunuzrnwepbfarndrqskqqvupeohtvhmmxldsovazeihyezrtcauogayqnhocuqquwolaogeigngpzkqojxjlkakwimvveczkfnuskdordqappdxpqyuneeqoargvrpfyleqtyobbxlegkbigzigqshrdimn" (answerString "nqhhlulbqtgrmomikbouwfiehkonaqpvlhpracfnlctduxehargrlifowhfrqioqggkssjuymqquhqorjyocjvyvptalgrvwqraqterdyobtdkxlhnrmaawomhngeawmuwdjvcwczmgrbpqgugfsahkbclzjzulpzfyxgvqlhmqnitghcvenbxvacxljgygnzjkzslzyeqbggyfhfuammnraogkmqpmvuiizagwrauuwrkohrokrvtkbgmsxkbdflmczshzffptqzgjzftddvkqecpasfwsezqzbjazuyasdufqxafnwghcppsuzijzrqyhvwbxvqhalyabhodsqaadoubldztoqwokqfaoxnrhfmvkkshnxcykvugskahzqrkzumkvjxtuxyatdmblsrgtafxsbtrxafodnfdshlytekwcgpxnstrpzgicbooaqinrhonhxcrimkupurqpscdijmzxjplexfhdxjtsyvfsnbjclplrnxzdbzglapdodclqrspojvltafjsrkuqjurgnpolkukiatdhfdghqidwqyeofggxxqvjewqupzasmfcqytpqotbeotopoffeucbcytmuisvfbnkycsrnzeflzkeosygbnbaaotgzklfeieypjdjtumqufihyddpzauzqcheuhebdvfounreysaodysxoyilsnjskoxbqcnhqsazjlekviremqyhpxptayfxyuirxzsoxlyzwgcpratcefwlldyvwnqrenxsyxkjuvvpdbauxveveupezardgcwbbabvblmolbwiuyryyauqqiopkimacxhxoaymrclqunuzrnwepbfarndrqskqqvupeohtvhmmxldsovazeihyezrtcauogayqnhocuqquwolaogeigngpzkqojxjlkakwimvveczkfnuskdordqappdxpqyuneeqoargvrpfyleqtyobbxlegkbigzigqshrdimn" 52)
16
+
17
+ let test4 _ = assert_equal "zzzpdxwwlggnpvykprhzmhplukwyipzuhvnzrifbfvoangtrgaeutxafgpduvdguvfxhrdoyhlpgebaycpfphsdljxgjlvkxrwlabunpzpkyeafcswjgdufdchlkjxkryzjwpquvamrxubayvncumttopnvpcojarwevhuvomxyduzbgpecwkxcyyaiuejfturwtcrndzgwjsmmwllykxjreejqdcuzhawrbwcucpvrgitqjbrdptasbhzagsazrwbzanweasgjepazztlkjdwudgjzhrllwptbgoegklazudxrzahirihfjwymxtgqtxcdwiyaxdmaaeteyqtdhnlekjfznluzctpdrturfptnphkzlajydljjjvubpxpyjgpyhmaidewxgkhwmmabnhhbgfkzhunstvmvaeqvsqehbeynfqjbscnldzhxjrvvuhpwygnictahdzpugzqnisdzbqlewzdxxltxabgludzqmkdbczmvqymwrsydhclekbekufwmnilrrrpbuuddpiqyrqrmxpxuzavcbwvrsvrzlzzkoxllmkfoaujuhmmanicxnqgbbdckudegysehqfvhqgoduyqgrwsrhselnmvtibzsecdzckczgyczspnshqehhjauppnwwrvbeyyurtsjvyhxsuadmdqkmquwmsbxxgjwqldocyyuztlgvgfwkvpovuulmtrftvhhndoreqsexhlppggzbjtppvosorlfefjixilauqnrclnloohxosukfhgzjaxeynnjdixrilbgumfbxvctcvmshovvykaunhduejdwdrzsajzbtkujjkvgbvngconqsfmnghiyzwcoesezuuuvsjwwxmzrsnhfeqtlaivypffbynxbnrwspyfcmlnljoiitjflqdwrztmxqmpcvvw" (answerString "hgovxgyedsdnatuzphaihyzfehukyziongysyddryyqnkqgnxweamkurjdzwxfvcckqqgonpfqhnsppymuymfedmktzqkitonxnonjxvqjjvydapwwmqcnzybchzhslrdqaufdipeocoxejdlpbhibbtwngseyicpebsxljpwspmlbrckmhjzngyhjbxyqaiqumjefdctxxkffylekvqzytzqawycwyaqolbygwwrhdxejoybfpunrzplcsaqyxifsxzpionszwjdzjtmacrdngbipiavnencsxbdhhkvmxqycalfewrhredtgjkdufxypnakmahmcyqfbhnrcihdtjjrmtwxcrsrxfbbommzttocudtjxrlqxrzbeixfktugubxkywbtokqvavwlpunuupfzlhzsxxcviptrwcxhywqtkrwnuibhmokdifogpnszlhhkevdtlbuaqbvylejlswgzsvujxzogfelmxstnficwvhouywcdjpeafiqcljnzywxdvbmawtykwxjkilbzanshavvnhznclharqdqeeuixhlzigbcyrkifuwkbborgwkyvhgqlmfyykdrvychvthoitenhbnxyqtdgebatkqtfiuxgujsohqfcyteifckxmybqimwxeojmdrytgbxgqdfhzgetzqeecbidrkkmzuflscsrkuvwkvqgsqrceczwvcyetjamyzvfsnafbiqseplwedwgvskgjxdneadcprrxgchvamniglwabkvepqivwiqsudwemihazoiqlhuxsmizhjzifxygmdxovzqvnsxcxtfwagsesoqvyzzdgavqvcqbibtcztkoksnycqhocikwimklkqdqqizxwixjheinxxsxgihxamcnuapazzbceekxatrtizxpvpftzhmmwbxkpdekdswckgplccfoykaqmhwdqqjemkhmcouywcvnnxsqpbzndwzcfvkrqdexhggaznucshgdrmzvsfenrjbvvkffrzbtakeaftgoenthjztvjtbrrtdazdwgerbwastrxtmqyafbxblubqgegiqiaxvdrebobpmwjrjuznbqqzqhcdtnyclxdfrwcgssecroipywqmbhltyummirpotfsexqplmubtodeumjjjorczryxeliuxtzqwnxrjulhxqzzeuqezotktycjbvndpupjprgirydnmkotydldfktccbvgtwhjqefgezyvcfnaswhalezkzrfjhtisfinesamyncimssowcpbqcfbmqtaqpyeerakffcozqybozsljdniaxbazsrehitrsvwyspdbokxusikpnjpglczaucqmtnmppkrafgwhmapocttufyljvgqmytdoysrjxtxlfgbsdnbstinqszuhtkvktubldmptuzrjjgtlnmwoubbinwfippgibfadpmyovmpoqdgepejqullsfdxsikppakbcglsazxolxatkpyjvebpgscxatazcycasirtwddqyneghvbwfuzjsoqhjibjsgrkhecjcjrpzrzjbqxghhppllgxcapvlharaatzfejgdjshyxramofbpvkknwddahrvelyobldfwmxifhzrmkqhiwhztjpowqgronuqwevlfpzitstzwmxtfvbegbasoapdjaimnjghemwnbmirjqbjtgbknwrrdjncfbaseuaymsbfiarjilzcvjyzwewvyrymxwiwgvztvrbmykapazsvrbipikvlpvgfbyfzfllairuitpqsxndpyngrfpjqvwtnwbosvasqmrgjbjxcmzshqbmtrngrymkrycwzbadxrnuamezvvkksyyekggffpdnmszasuensawjborimrzdlwewgbcfqmjdomwexvdowhgrfmwieplfmbycdfvowbopqxgblfiwufneaoggwwzrnthsjwswsgixkvfeuclbcquzptiuekvilguuocdprhjmajnsdggqoeyzqdggxqccesfepgdefpupgpdeohqaouegmiteiyprcsmqndmoytwophgyupsaifvlnrstccwqdgfibrpcausqzqhyzoclhpaywidsrzntlcwvxfykjgpmirwhxzbvntrmhhmxutwholzutoyxiumdfetacoqdwuipuebserajqcekbsvuhgufpnboefujokdyvcsyqurwqtangkmzwvobdbyzpovbekdeuowygmyfppydecqmpnjnluwwghxnxzofhkofmyszdgookxduggpuahrcpslupxkdyizrwetosjwejmscaxxglaliuhxonxchwdxvcrvkgstvsivaykkrpoktrvxkqwjxxiomgoewddiymuvwniyubzfctjemjlkwdzbyukgjoihcqvxokwlygtyruvrcolmpojkdolxditadpublhlxusscrrztsmcbbbqkmskdquadrglznprnzoggsalnirfeylqigkuxxfqbothcurtkelsyazvxlnfvvddhnpmmimaibiqfwaugmvlfibosinfyekajflsdtkgofewsnxjdplhkxzkyajhkltsrlmlowpwjncohzasinepkxsradiqbwylezzukapgxdritnxbxdktflgslkbdmgoddnoldyzyvaoqjtyrvfqidttgujhvkueempozmwrjfocnjqzbbenenyellejwqjqfjdzptgbxsrbunivfzgctnlefqasierucgmepzpnjwxeviudqmwunauqcwtizforapsqkaouhrmxoewpqpkrasnqtpbgiyzvkrieaepmodrtzoryhjtrrjbqejomlxfdsltlebvxyqpnyfgciabeyidgfdsggwaqlzucisqkzqjltscqifwbligmuioiukjddycilzqfapvhtqcddqsjndslmrpbgjsybnszmbqicjubpaqqzzjnndlkyazkagubzyxlrkxowruxlkqqgppogksmlyyxohcvpwjpujvyppolqcvolhvqddewicachmkinhnumbnagyafzieeeujuxzolrjjcmjghxpbfxanffcquwvpvmffseiatqmjgcilczzzpdxwwlggnpvykprhzmhplukwyipzuhvnzrifbfvoangtrgaeutxafgpduvdguvfxhrdoyhlpgebaycpfphsdljxgjlvkxrwlabunpzpkyeafcswjgdufdchlkjxkryzjwpquvamrxubayvncumttopnvpcojarwevhuvomxyduzbgpecwkxcyyaiuejfturwtcrndzgwjsmmwllykxjreejqdcuzhawrbwcucpvrgitqjbrdptasbhzagsazrwbzanweasgjepazztlkjdwudgjzhrllwptbgoegklazudxrzahirihfjwymxtgqtxcdwiyaxdmaaeteyqtdhnlekjfznluzctpdrturfptnphkzlajydljjjvubpxpyjgpyhmaidewxgkhwmmabnhhbgfkzhunstvmvaeqvsqehbeynfqjbscnldzhxjrvvuhpwygnictahdzpugzqnisdzbqlewzdxxltxabgludzqmkdbczmvqymwrsydhclekbekufwmnilrrrpbuuddpiqyrqrmxpxuzavcbwvrsvrzlzzkoxllmkfoaujuhmmanicxnqgbbdckudegysehqfvhqgoduyqgrwsrhselnmvtibzsecdzckczgyczspnshqehhjauppnwwrvbeyyurtsjvyhxsuadmdqkmquwmsbxxgjwqldocyyuztlgvgfwkvpovuulmtrftvhhndoreqsexhlppggzbjtppvosorlfefjixilauqnrclnloohxosukfhgzjaxeynnjdixrilbgumfbxvctcvmshovvykaunhduejdwdrzsajzbtkujjkvgbvngconqsfmnghiyzwcoesezuuuvsjwwxmzrsnhfeqtlaivypffbynxbnrwspyfcmlnljoiitjflqdwrztmxqmpcvvw" 1291)
18
+
19
+ let test5 _ = assert_equal "zzxaecjqqijstfyvnfnacupvgwjlvbizvicdgdjsyvrdabzelxykfiixkfrneqfvbqmnyimcadkkfpvimfkwlehlhypukitwzgdcsuxsrgtccwxjmlzmudinym" (answerString "yzooaprdvaoqzktnczenjnltzjdmcqectaqueylzpinnohpptvqtyqghnrowruhxvcppotfiwxsbwxhwaxcveqkpwjvodzqcpedsvsizgtosxeddkfrnatkebrxgmcbmfvxdmvtxpthlqazeapchclrpzwmeecktdcygffuatwwemenagsujyulaiyatfsjcyshqhukkngscafxonigiafzvprcdqocyroxkebypfntbolmiilaanjqwmnrgfmzssccnpgpxvkrpdxtaauzhakpoqjvxkkstspnmggyyywdufrlcaevwuupundwrdcqqwoiyfbtpxvlsjlfohoxcvvbjufuavfkgeheotrtvljoqetnjtarhvcurmxkvwtrkxzxmeoqayctvvqdatxuwrdpcvvhxeptymahvtvnxwiiyuelzsqjdajuhikuylgjeifnxwfxreulmwwbjzzqfrzxgynpfiubzlivwpugslghibgmpiwsizlxqxanglkdxotdkjzwdxhibwkefdbukhjftevihzjdbxpuyxbbambizysglbnencrojevquchutrvycqezrewodmkcvuqrqevzrxufplpykoecydlfoltqhnjoeofsvotgzwlwolfwraoihjdcruujefuxxfzyrxywmtdtlpjpsbtbpbwlruifpmnvdiiucebyvpewplxagwppfbpqzxjrzvyqctlaoszbkdygxokltzxpsykinjikrxkcurkhtbtaggmovxycizchgftsadkjydegfzvvbrqbiemauxmuqukxclttphdixjamaacrgudgqsmdhdwrwebmlesdgmyfqqygntnwzxudrraouawkoybwjoplkualabfkuxtcqpvlvofxollodfhfvbdqathriydcphjiivtkfhinlbqkvgwwevhlsfwbaavbjlyvypqhsrdliaplcpmwnoccjadfjfhotekewomwnifgjfcierbevacpvpqcywkimogzlhjslbmumqtmkgirbxxpnksprfhpefdkbjlfinmbyhagofwaaquaphbleyfqwmzjuvmhmnltjzhptpjmhoibaiyguimougynbracmesntljqcthdcjqhpqapwfiihxmjuwubsaeesjrdokumdimylyagmvsplbmjagrgtwrfpbosnmyxggbllkspqvnvuzdcydziipbhafkqbqjhsiswcdozahuqeydefkydbyrpotgkflndtggouvigfnfqoruyrigbkscvgvgplkspypzrltujfjdfwnonchxvtjxorqnlkaxuxfzieyksvqdvubkinpnlmulkzovsvjxquudwwenghfrojboxttmmsijdmvbqdqniequbzsmmsoptkmqejrxzjeaxjglntlqvvfekeezushdwdryixvamiwzutczzddsqymfailndskrdyxblgsfpaejyccriktkbphddhgrwfkxzonogpuyosngmuifoxqtnrktkfoisiqqujhngvptdpdsaycnvjifitmdfrhhfqptungactlootfphwghanttufuuwqvjnmscfkruzqnddrzfgcwmkhzymviiyvoveupbwlllvnyfjdxfdjkkrjarjhpbpodcktqerodbyzjomsdjggvfksajhtxsjqsjqxknclnzglzytxfoqbcnrtkxpjetjpfjthhhmkqvtgazybaeltwsmwhnpttwleovrdzccjmuenuhdwtatrfadcbjhbkplpoomqvcxjyxekmmicqljlezrgwtgcthjizpkluavdjezhivcnoecahsrxlzzcqfagoitjstqcrdwaxfhnxytlyliqpeffxyrzpmkdmvcgcluepcpmensdkwyrnyqmdqcpcwhozdfynkjdtkmvlayotfuedjlysdzzxaecjqqijstfyvnfnacupvgwjlvbizvicdgdjsyvrdabzelxykfiixkfrneqfvbqmnyimcadkkfpvimfkwlehlhypukitwzgdcsuxsrgtccwxjmlzmudinym" 1155)
20
+
21
+ let test6 _ = assert_equal "zzxeifphgdtfvtwwngpecuztccfceinndrgbfazdofhpkpjwpadpxyoxclwkthrxeduifauwbmklyjsysppjwrkfasnhdqttyzybaatplakupvqvpaurbfrvzygnzumlsycoqwddibmzkmvfrupvsjcsldinjtyvkinjliawmxzvrpuikobiesrtqnfbdeukctnsvieqpbmzjoedudiqdifkjbapgpbymplxtfllxsiuwrveryolzmwvuzyetfrellwivwidhgrdmhhcxwcyqlebtvrsfmxcobandiszzomoefkepzsvjjbyrmitthmzibdhdipwlnrnxrehnwbkofvxwckqaqbdelxqphnqhmwezzpyouvvlsayhahraximkmduxbzvlerexotcnuwvhwwnvnssuvcpvhyidouswfxftcmqpichaiydigyvvjxhnfrnahcpdfpqxmyvncplydsqpqtymnuhodmfyentoarnadqjwyicdjkcbqepcepjrwnlekkrhhmnrhanllomioueomzqhufjakfyzyydnzizujaivzrzmtqkbambtendtlgvcuvvcayqkhwpvqgrjoavuwcfzwwtutnnrelztvqqtmlebzmtklvvraonwroamhdfxhrqmzimvnoomfxkryyhgxexzmofgurgzndxagixxaxlqepapepyniqjvfhclawlmvrdfcnsgntzdcuolfzfvmrepnbypzovxvdboubjfkinegrhlzcbcuiwwapsvmzwtrbszdpztcrwtctpqvyafzybkavdnkydmkzewwaklypahnwlracyozijimduggoxuypqlwwefebsjbvracqyaakksrckcrxbgrpqlvvduedqwzrpexpqlorsjxiekattpyiobateoayfvnobzwhghftzsjnkapagtjwuvwgmqalpflfmbxnvyylliivoakjffqivwgxadpgmofazoujslpbmwsvtfqmxjufngwnqlgsbmmjmmmccybsbabjkeauwlqnaapfzfzfzxoajvyforjhmzkxfuphhvndpmytftdisdpbyvgjegpkmzvrzpklidumrxhwelilkaryvitffsezrmgdrhkfbntrnyhadfbieebtxaovwkojarijpaswbsaixhegtplyvccwwhggqfmqpdudermtkwokhdaqpqvswtsmborzbgyzzlnfumzfavyvvgoztlgghzmnwtisouzbdvwxguxkfigntfgkvlrmmbnotusdrufvcyclstssdkgotccgururaasjaighwzwsvzwrtguxlztvnhrixtgomjjhmwlrylchbukdjvfhppnuufezswgaplsczmwxnscnpovihuvftoahwjqamuiwkygkcosfggimvgspnzedrddkjsxmrlgenkursnrjclkfznxvjlimhwmoghealhoskuntkluwbaafzvutlqvvvlaprnfszqehlobbgrdcrwudfhdkdpuexusjiubynhrrfhkeitdaicskbmasrvuaypmtrpweqwtipmtvzfvpafgddfxmkblinuytnjncoldblmmwbqvsritbwrscftewryhbxdrxcgmwecblufxbk" (answerString "yseprefyjfiyksuqcgzhqrijhdtiusveffpnftzzqaasfbfdrjevnpkhnrnlmhghqhfpypdlbuxoezqguckuldgmziflprrcuwwnnrtfvmxlvyvnfcluunhlyujgbwmnvhvvuwtnvzybvixyfnecrwvgnhlsubeqfhmacezswjbvsapofisvregebwmmlyuwthxrfmdlmniiycndrhiedwytuozlxaszhqejgcnptaowzsyevtroaoogidvlnwlmtzqhotuzmmaxonoxfogrewqbulafhwqnpxbyfhdcluysxhqsfbcjxwfjlujycevnjtkaguipxnebkiyiaspczmhjgqnajcpaglfcmwmbesbjmwsxccihpyhvjsxmzngwmbadiumcvqbmucwuhnswwusbexainqjwuedpjcsanmbctufubojdtycnzvikcsqzrrccbzfxjccjivhtmfdddptkfspdhzwmawwymcnyvzbvduocnktmdtbqmtbefdztvhgzwfqzxmragglgelmbqzouqnzvafptuxkabzbeffpytnsppnvfwvvvdnokuzlkniddhneeiqmpkzfbqdcxawkxpyyypjspegllflricvlaavfozwycnuaefhliaklmapgkfhrpypkxbmrbxeggqcwcwmgrqrenchnfkloxtcddzpklsdacuwdimnvgsnwadtmyotjrbzzxeifphgdtfvtwwngpecuztccfceinndrgbfazdofhpkpjwpadpxyoxclwkthrxeduifauwbmklyjsysppjwrkfasnhdqttyzybaatplakupvqvpaurbfrvzygnzumlsycoqwddibmzkmvfrupvsjcsldinjtyvkinjliawmxzvrpuikobiesrtqnfbdeukctnsvieqpbmzjoedudiqdifkjbapgpbymplxtfllxsiuwrveryolzmwvuzyetfrellwivwidhgrdmhhcxwcyqlebtvrsfmxcobandiszzomoefkepzsvjjbyrmitthmzibdhdipwlnrnxrehnwbkofvxwckqaqbdelxqphnqhmwezzpyouvvlsayhahraximkmduxbzvlerexotcnuwvhwwnvnssuvcpvhyidouswfxftcmqpichaiydigyvvjxhnfrnahcpdfpqxmyvncplydsqpqtymnuhodmfyentoarnadqjwyicdjkcbqepcepjrwnlekkrhhmnrhanllomioueomzqhufjakfyzyydnzizujaivzrzmtqkbambtendtlgvcuvvcayqkhwpvqgrjoavuwcfzwwtutnnrelztvqqtmlebzmtklvvraonwroamhdfxhrqmzimvnoomfxkryyhgxexzmofgurgzndxagixxaxlqepapepyniqjvfhclawlmvrdfcnsgntzdcuolfzfvmrepnbypzovxvdboubjfkinegrhlzcbcuiwwapsvmzwtrbszdpztcrwtctpqvyafzybkavdnkydmkzewwaklypahnwlracyozijimduggoxuypqlwwefebsjbvracqyaakksrckcrxbgrpqlvvduedqwzrpexpqlorsjxiekattpyiobateoayfvnobzwhghftzsjnkapagtjwuvwgmqalpflfmbxnvyylliivoakjffqivwgxadpgmofazoujslpbmwsvtfqmxjufngwnqlgsbmmjmmmccybsbabjkeauwlqnaapfzfzfzxoajvyforjhmzkxfuphhvndpmytftdisdpbyvgjegpkmzvrzpklidumrxhwelilkaryvitffsezrmgdrhkfbntrnyhadfbieebtxaovwkojarijpaswbsaixhegtplyvccwwhggqfmqpdudermtkwokhdaqpqvswtsmborzbgyzzlnfumzfavyvvgoztlgghzmnwtisouzbdvwxguxkfigntfgkvlrmmbnotusdrufvcyclstssdkgotccgururaasjaighwzwsvzwrtguxlztvnhrixtgomjjhmwlrylchbukdjvfhppnuufezswgaplsczmwxnscnpovihuvftoahwjqamuiwkygkcosfggimvgspnzedrddkjsxmrlgenkursnrjclkfznxvjlimhwmoghealhoskuntkluwbaafzvutlqvvvlaprnfszqehlobbgrdcrwudfhdkdpuexusjiubynhrrfhkeitdaicskbmasrvuaypmtrpweqwtipmtvzfvpafgddfxmkblinuytnjncoldblmmwbqvsritbwrscftewryhbxdrxcgmwecblufxbkhazoqvzgjpsrohcovautkplmcunaesvfneycnqonizybpzmfkzeuuwwlajqytgitcjnyvfbyvlitbxmumqvybhzeeleekfggglhhrruqfeovwtjybxilvifoklxzstwnvogpyqoulticefckqfpydrhv" 866)
22
+
23
+ let test7 _ = assert_equal "zzwxdczngdklqaiqtvqspqnbzwosgvmldlrwcucsiwmuveiokojvdxtcpbutojndmjqinpkxrchqglopowrzvbvawtneqpvkbqzbwoepbozhwwbxxxnbzqpsmoclretffjliskxkirgfgwuasebvwhcdxrodakjnvqfgmzrfzoucpsywbayscwelzgcduicxohcdewzngmwvkxmqatpkrdbwmwfvmtyupmqwukuazraubnsesvauirttvdsehwdtmincrsxvdpmyyvnblnnffsijtduutrswdckviakzlegssikizfpyspdvqatrxlpvvfrjqeqsizdetwnovzqkcqrvzytxrjizkzdhdyfvqxkopwfbejmmidnjymreldtdaoxlcllzsazsnejqdsrmtpbirsmxgjipcoqjonwphsrybvcjtaklyqsrhrnugtruhbnszdzjteoyjsliigpmckjoxhtixoskjmmaixkfccwpjglojvxewhcjaphypzmccppjlgokcqeepxngxmlksdxmyameinxhzjolvliplryjqqehersizvnnhgfcjtrftkhrpzkdilkrxlindhehfxxarksjxhzwevhfcehrftfwbnabfovvsiebyeicollnxitaewnwemmskrsjqiwzzcnmfefzoyyefzmvbclndmicfyicjfmmzkuzsnvbjxnvduqkivkregbxjcoe" (answerString "upjrxnvfaddgmgbdnwjitnmnwdinoloslhxratpspztrcwlhfctpwszozhxnonbehtswvxcvazybgxgpivorjasxbsdgwtczqcshewbuwdrugmmcpudycwjrokgmamslymdnyhxxejnlupwlvqrfqukiulronntnajgxtihlfoklykeeonoxhubgnjkbmndxhnnxazlitutmianfhtkfkbpfzoelexmugfhnyvsyrfhrnemtqikzpvtjiakxreuzzwxdczngdklqaiqtvqspqnbzwosgvmldlrwcucsiwmuveiokojvdxtcpbutojndmjqinpkxrchqglopowrzvbvawtneqpvkbqzbwoepbozhwwbxxxnbzqpsmoclretffjliskxkirgfgwuasebvwhcdxrodakjnvqfgmzrfzoucpsywbayscwelzgcduicxohcdewzngmwvkxmqatpkrdbwmwfvmtyupmqwukuazraubnsesvauirttvdsehwdtmincrsxvdpmyyvnblnnffsijtduutrswdckviakzlegssikizfpyspdvqatrxlpvvfrjqeqsizdetwnovzqkcqrvzytxrjizkzdhdyfvqxkopwfbejmmidnjymreldtdaoxlcllzsazsnejqdsrmtpbirsmxgjipcoqjonwphsrybvcjtaklyqsrhrnugtruhbnszdzjteoyjsliigpmckjoxhtixoskjmmaixkfccwpjglojvxewhcjaphypzmccppjlgokcqeepxngxmlksdxmyameinxhzjolvliplryjqqehersizvnnhgfcjtrftkhrpzkdilkrxlindhehfxxarksjxhzwevhfcehrftfwbnabfovvsiebyeicollnxitaewnwemmskrsjqiwzzcnmfefzoyyefzmvbclndmicfyicjfmmzkuzsnvbjxnvduqkivkregbxjcoemanzavzfoesgxquyyrgaywqqmhejsnlegsoyopqbitzcgipkosolbhhytstebqyqlaaqoukdvoecetgprgtycdyaanpdiifsikbberdnljwertlrswmvmwsnjwtzanwfkevemejfxmjzhxgmokogisgsjaxlsrhwvpbkkyoybypmawclymfpvhtdeyggwtgapxszgoctbpimitekvkohcleqspddrtvuynycqfhpusubsqqcwfysjlcbajqqmotzrczmlkvcdxbnghmlufqsetrznxizdnmayecqrlmyinznsjnqmmiuytvvvkocukisovkaouqwrpqkryvxtzhigixadptczqkkmkbjeyypffkwwhfvijdpplxvadoioduqfxxclabxqifdnbqrvfhr" 660)
24
+
25
+ let test8 _ = assert_equal "zzxpgpxmowxyqxgphwbjvckmmfxprfhkuvsjebhqxxplktjixcackcahmnyhsaxrnulfazdnrwsqyebhckdbqmrwtyabiyolpbcsvgrcerknoxhjjgfqtlfstdbomlkfmvadfbjqeqfabtihllgmxxyuctdavrhekslplawkpcrjmsxhomtconljllbwzlghdvtdsvhcyslsylggsjgziaklczrdvbvtayhceqwnpjsfpglhflmxupngrsffokcaezoxukjohpgbqdmbnqxueodaqodeisnojffczlhjivvcwhlinonvsinjmpcsbwspksmhsbymijbuyqxqerlmwtrrdafegyftlwzgvibkqfcuiszbqbyapfudraxfjwhdaxpvkwrldngfsvcqadsthifmslzbywxmpelecohuxjifqwdlpqkesmkegzkzprsxjnrqpcdjcwyfkzjogrqctalkwipgornikmakospakcdnbppobtauezamyuhaguanhyoscljsafgijruwnxhivjazayfbzvosbhhwmatbxjfyienzxerkkgkucwjzckrjtvrncytkoobumiaqrdftutccznamwpsjyopgegcpitjnqxjkkoanbsxenkevpjslazopnaqtqhkpujkwifzhsvopzpvixhzmhzwcodboyefaycyzfnrpavnrhvjrefbsmyljriqimfzpjeydnqinwtjnombbxclavumletelyyszyicolrowrgcybeerxppalihmpqkawlpthivsxledbhwixjykfftckysdpgsqozteespojtilthagpslhpowrrppjzmxqyamyljnrfpdfnppjsprtwmjvpxaayazwvisafxzbsbuggmjiapbhkjfepitegvawaohtfooaujuiwwqichdypoklfgizfpvyqdgeqgxineilzoljhattpkowyqnwsjarkdrcqlgwkcjroncqtrmqmlccukdgrphaqbhtaijcyxwdnfsffcmwjgiwasthrqxemgwrospprakvjyzagdmxkbzyklpyqbjzhxcysboftspbjbrgilhyzvbcpixvgboryoenrbwesctspqangwzngeurzznxeyazqpmvzmhndpxbwasckadxidfgyrvfxwsqecfuwjdurxlzlxujkgjiuisriwwytqbrctsnazhyrspejqfusoltzfehvxmnuhiriuhsaptwxkxohnezuvgfbquuntiopgoxytfcveyrxrbmenrsdlnjylveskwtqbkfccikoszkufaifhxypuoimuhaaljqsrhmhbdfatdigkabgpflcpvkrliohqzxdftpwjzoukraetlbzujrynjsqkskfhzvzvpoajtlelnioipqohujrvzfexhfieezbfkudlgroxcliuzbetjeyltlddszdbwshlrgorsbxkqzzdrrqgtuejopyembnszbtlbyflucgvqgriglqtvqwmawgncuidsapdbcrhwxviyotqidzjpbbkcizxsglfmxnlnzqglnkwdtwnctdowiznztipjzscnefqhkkeeraznemddmadxcljrtrrvcjoejlhpadhhveoejvhbqlpmlfpfbjyyqjdjmdzmbmbhnaxgskiyogijmbdyhlqaxzyfarlbrxwcewehlrjrekrtgehufrbvqrohjncywgoyuyyxukxyqleumizhoepekrzzcaviupwolefyozbmyfttavgwfwcacxdbdqhytpxsvffkaohwcszcshjkdlvnuicndsryx" (answerString "wquhoneqekcevqizamfwmguyoxzzwaayqoajgorzwnsztazyqntvkmtatrzhlgnqvnfeldfmbeeyehczxuxsnpdflphokxaqrouniyjdenomwlxfwghiaffevhzdcmwfwcylwpjzijvdgxjiaafxtqzjvenuiyapiyzzxpgpxmowxyqxgphwbjvckmmfxprfhkuvsjebhqxxplktjixcackcahmnyhsaxrnulfazdnrwsqyebhckdbqmrwtyabiyolpbcsvgrcerknoxhjjgfqtlfstdbomlkfmvadfbjqeqfabtihllgmxxyuctdavrhekslplawkpcrjmsxhomtconljllbwzlghdvtdsvhcyslsylggsjgziaklczrdvbvtayhceqwnpjsfpglhflmxupngrsffokcaezoxukjohpgbqdmbnqxueodaqodeisnojffczlhjivvcwhlinonvsinjmpcsbwspksmhsbymijbuyqxqerlmwtrrdafegyftlwzgvibkqfcuiszbqbyapfudraxfjwhdaxpvkwrldngfsvcqadsthifmslzbywxmpelecohuxjifqwdlpqkesmkegzkzprsxjnrqpcdjcwyfkzjogrqctalkwipgornikmakospakcdnbppobtauezamyuhaguanhyoscljsafgijruwnxhivjazayfbzvosbhhwmatbxjfyienzxerkkgkucwjzckrjtvrncytkoobumiaqrdftutccznamwpsjyopgegcpitjnqxjkkoanbsxenkevpjslazopnaqtqhkpujkwifzhsvopzpvixhzmhzwcodboyefaycyzfnrpavnrhvjrefbsmyljriqimfzpjeydnqinwtjnombbxclavumletelyyszyicolrowrgcybeerxppalihmpqkawlpthivsxledbhwixjykfftckysdpgsqozteespojtilthagpslhpowrrppjzmxqyamyljnrfpdfnppjsprtwmjvpxaayazwvisafxzbsbuggmjiapbhkjfepitegvawaohtfooaujuiwwqichdypoklfgizfpvyqdgeqgxineilzoljhattpkowyqnwsjarkdrcqlgwkcjroncqtrmqmlccukdgrphaqbhtaijcyxwdnfsffcmwjgiwasthrqxemgwrospprakvjyzagdmxkbzyklpyqbjzhxcysboftspbjbrgilhyzvbcpixvgboryoenrbwesctspqangwzngeurzznxeyazqpmvzmhndpxbwasckadxidfgyrvfxwsqecfuwjdurxlzlxujkgjiuisriwwytqbrctsnazhyrspejqfusoltzfehvxmnuhiriuhsaptwxkxohnezuvgfbquuntiopgoxytfcveyrxrbmenrsdlnjylveskwtqbkfccikoszkufaifhxypuoimuhaaljqsrhmhbdfatdigkabgpflcpvkrliohqzxdftpwjzoukraetlbzujrynjsqkskfhzvzvpoajtlelnioipqohujrvzfexhfieezbfkudlgroxcliuzbetjeyltlddszdbwshlrgorsbxkqzzdrrqgtuejopyembnszbtlbyflucgvqgriglqtvqwmawgncuidsapdbcrhwxviyotqidzjpbbkcizxsglfmxnlnzqglnkwdtwnctdowiznztipjzscnefqhkkeeraznemddmadxcljrtrrvcjoejlhpadhhveoejvhbqlpmlfpfbjyyqjdjmdzmbmbhnaxgskiyogijmbdyhlqaxzyfarlbrxwcewehlrjrekrtgehufrbvqrohjncywgoyuyyxukxyqleumizhoepekrzzcaviupwolefyozbmyfttavgwfwcacxdbdqhytpxsvffkaohwcszcshjkdlvnuicndsryxypftvxywpfelwerwlwhnypeomxavglwukcztbbjlsiujwzxcdtbwrpjmhrcdqkurufmypmxqsaeghzyyluatbbzgzahhiwkwlgxnwmxmqaomxweyftcnnfggrqttkejgmdhpbtisffcmqnxmmgvpsqlontiizxecjuvuhigbidyorienlfbgucbjvjyfpdawmfrrfcewvqtbhdyttwoayllkujujlkidkledkveupnnumlqrcspjge" 409)
26
+
27
+ let test9 _ = assert_equal "zxtfevjvpiqzjnyywyocplfdqxjaavnhujvzutovuflrwsgjopiqxgssutridwrckxwympbqklpbhakpgbkrkverfzmteoumozbuprwqsqeviperetmstirkmfqonebwzazpjbpyqckdnsywslpzqmzvjfclxjctfwgdmhruyrqbjqizgsfaofgheagfgyngnhfzqniatqtmwtcsqbeveuoxlkcgavjykbzhglmbolmjozjfutbrvggoygtggxefusnblccrzjxvxfvlszaefwemzrqkshwbkbddcwxwenbtoujyqzruevrrpvappcsellvqemtkeevodsuohsiqsitzgbcrjqdanllhpmnnphuehixdjyzuplzehgphvlkbwgdyagbeodlebbxqsfqschpavhajscelzfqpjkkrhazmissvpltlhamchrohzucwncnbxwzhyowcjbyluakpuknacjvorzte" (answerString "wwdowzbekluwilhhnrzhnbubunwkkphgtuyzljaqfvclcpfydhvrfjylvyrbdisitfwnkfwrvijcqsmgwqhwiskstvhfmdwivkvxbukxphnyxsamdprqhsnvozarqqgvarlgkejdimikelfzkeqtiexjmafpbrwypncraqpkzrvdzbmidapqpbjqsguyrrdbhgdkwsmzemnmaplcabcqhcpqbakqqrhngsixhnalapafasaqggpariabveqbbsnecvwleddsfhsbyrltsjkctrnociutrwnwaxitgyiazpvwojrnsfitvpjsqwibvzumptncffmllhcbrmgcudxqecpetpkhoycqmzeaxfuinokqsqddjicasgmqplictwvpiwrjmaxlywrbfwfhdkelqcgvjacktxyjksgrjmzqescapcdyhvgqpkqodhqmkcoisqgorjqyszdyweqsknkemrotbbtxgfvtzjjobgsvmcbudrdhpebyrmfbezwfwamsobmmaxxrwnhnsachvttrgnejvkcizouareqejverftbnxkfnfyxagomjqukeabthubmsfnxaibgertosfkxaljwoybhoufamjauobzkulmsknqshsqlklrnufozdcyekdvjgtvrhcjucemifsrznqfazteesnaxvqzmgfiicswjhtbtokcjuedhrsixphmubyxpktcrgybcadgfspxhmjhegmzjwurivdfsltzwqaocwplyloftifazourppovvdjkhfhbkxqjekzjtvccgcyauqtvhmvtthghozumrdwluexdnpmzfnkufgouknpihwvlmkxbglhxmcsuwnjjpihltsuibncrctdgzoilhfiazxtfevjvpiqzjnyywyocplfdqxjaavnhujvzutovuflrwsgjopiqxgssutridwrckxwympbqklpbhakpgbkrkverfzmteoumozbuprwqsqeviperetmstirkmfqonebwzazpjbpyqckdnsywslpzqmzvjfclxjctfwgdmhruyrqbjqizgsfaofgheagfgyngnhfzqniatqtmwtcsqbeveuoxlkcgavjykbzhglmbolmjozjfutbrvggoygtggxefusnblccrzjxvxfvlszaefwemzrqkshwbkbddcwxwenbtoujyqzruevrrpvappcsellvqemtkeevodsuohsiqsitzgbcrjqdanllhpmnnphuehixdjyzuplzehgphvlkbwgdyagbeodlebbxqsfqschpavhajscelzfqpjkkrhazmissvpltlhamchrohzucwncnbxwzhyowcjbyluakpuknacjvorzte" 552)
28
+
29
+ let test10 _ = assert_equal "zzsgoqqtytqgqzohraynsxodwfrrullcdxcrgxpuvbkziwitvbnxgvdzheizuxosorwbnapgedtgoyyjgnafkpyqpsmkgqanctviekbskqwwvuydyoazqdbyztynplytzpofvvkgyzzeuzqttxvvsgkbixxjgrgslljvzrquxqjujcgznhgxbnjwabgrxettmlhdjuodijtzadpexbpimlaidcqgdkhyaqgphttmijmdulgyckraouprhyzvivzhmfhoebhhlsdyrrachmyanahicefsmtjokukltvyjtkebrnyhndfrlyklmmdrvtbxxzxxyztsdwqvyaskivhpbleogyzoosmduhdjhmpjhmbcoerchownbkblxpollkfzqgxbypniwmgstythhccstuvdxjaqxxjldzqefnvervmmskycnjgyhzbclyazxwguzwawtowctyzqsucbrngtcdpjkprgmfjzjqlpvngjcjrsgsvidlwlyeypyjafdxvzeizozkvidtimeonwnjsburseshxkxswfnbnvohkyvjcqnvvfzlkesyvmrutzjhlqtwftmmsanhribbeosyjdetefjkmlxayigpwfvqyzjrvkxikdmaxvxoyyzxgtrogdsdpbxqwbaoqm" (answerString "gxfauzngwhlfcmmqojqrfxjnalfryjaycmkbcgsybaqkkvepszyyhxgxhcwlmyfclswoooiwxpuljpkakxhvsorcqfjcjtmregstksfmonhtjwbenydtxznsidcobfgqgrxotcnhrjrrlypfwcuqtkfvaiwnoobbtyzhfbpolecmilsjihlrfxnnxumzodyfdpsrhzwomsvvelxqiehitvzoaatjwtuelgvghovjslfkvvjysuwjrxvnqzxqjqynidnrfratwombvfiepdwleagsmrjvtawxelkapjofdxlqrotdwrspossucamofouxeivriwlqcqybgkwpaxipzizyvxxjpyhaivknlozhojxpowxwlrcfbpwzvtxgmfyetgcjfkfojblhcxoqyxaddcassgaybcflwrzpblvjkirflxrtocrlxmvyhqjchtgnmncoodfqgskqrefdsrjioitktfrmvlonrsagmoxjbgpssoefjunmhwshgownhwviqqdvsjlqlukkrlyqvruenmgykfmkonqaqypsmhxbaakjeubpywowbwbzxjdcxygxyfyozxexcudgerpcxivxvptsvzlklnhuwpfwaugriqswaqfwcydxeksevzpzaibrlnwsmxfnxjutjnodjnirltaacemzchosvowqxebshnjcubbjywkxmyjlzhtuhinqhhpksrnaccnkmzaazudrvomfahmywoxwnjykxrjhcrmcfymrggkqbjjvhbktyyavmkaaezcxifsjzahyzxouwqywzhcsdbhizlhzktauadqkivbbprrscsgnzxeohfvmjtmmcajmbmrkbvdycrxqseynlzgtayhjyrkbizzovlgqnbrymgesfizdmxvgrgdyroujledgakalratnkqbvfkubpvglmbsjrdxharjygylswykogkveztymonotpnzrglirvvbohuuutsxdfeshrwmemspqscjajsyouhofkdfnywjlrxzfhtduwbgdzsojzinvjtqkvodjpaqmeiugtsrjacaxrswklenhviiqnotfqysemscliretoxoeyxemvvmzgjzgyqchsyrauqjbgwtomzrjbnswmjaehgmnjzscgnuhjxftiifebwvxwtfvqnpteqqesqjiizlaaxdxifxjlylviuyrmyroyohvghiumasrqudroyblagxlefvwkyczvybkutappeedrrbdwetpxuuidpxkpziafdyhuhawruyxxlyjerrolkifwlofosbnqnccnjrotmxerajrcttbywnrtgqtuirezigitakfcuotcgmxcwobiwlwpvhrkagpdzgnpocmuikuopzaaojrmyaxqadfembhvbcjrytqqiojiyvkprvbpgwkxltggklypevouwwisfdmovuyoehpbroxcdfqlsufypsehwegdcgkkoixqkitwuzsfzuhmkujxifvyiagbgwvvddseegfrhhwvinzdhenelcyklevkowbquyixrcbjdlechrifbwzihxctmjvfdrxqoudxsdjmywuuqepwekphtckhuolvafbvfzlmswagqazasowdhenhxbzdjumvhukekncatcwqbyctcyjrizutjscgrvyqorrkrqpctxfdszfxncnwrtqfnjgffezkstkhapuileavwkfjxrhnapgffqragmvqjufnikbkuvufwhkrxabdtpdshakosrxhegmdcjlwshgjamprtsjfvfjocgmlfpdlcwiaozqfvfrywxeervicrewnoejngdjscnhqrkyvcniarcrpqpkysxpndrtivaivclwezjhovhqouuyumjqpbycqnueeqbjgglwsixysegwjcwijddzijosmnsxwocrpzobylspauvsegnnztebgkpkcqovevodytsmtukqcjkevyolcdmywyvbisnmeaasvjxxejnwitayomaxibxjhcgtmharkkhkaabqkzilzgonnfqpetxeryuowprnwgihqujgspusxbvqcwvbjnvypjgjlrsptthjvuivigzxxienbszwcdhnsjobqvsehairzkoecwmtngrbvkbhdrpxzazaomqgyrswphxjpskchuxihiczczpqhtdyokexlftfwrvpbrdszogxhomqimcromnhcxvlgcgymrnsyefxrytbhpujdiyhhrgphilrnevmjbmpbovcmbmazvcxbjaivbsvocmzwbfknfmloqrevfucrsqojvoccqflgzvewabjyimmstuzkontrqncyaxumvmxoidzcuvffgzzsgoqqtytqgqzohraynsxodwfrrullcdxcrgxpuvbkziwitvbnxgvdzheizuxosorwbnapgedtgoyyjgnafkpyqpsmkgqanctviekbskqwwvuydyoazqdbyztynplytzpofvvkgyzzeuzqttxvvsgkbixxjgrgslljvzrquxqjujcgznhgxbnjwabgrxettmlhdjuodijtzadpexbpimlaidcqgdkhyaqgphttmijmdulgyckraouprhyzvivzhmfhoebhhlsdyrrachmyanahicefsmtjokukltvyjtkebrnyhndfrlyklmmdrvtbxxzxxyztsdwqvyaskivhpbleogyzoosmduhdjhmpjhmbcoerchownbkblxpollkfzqgxbypniwmgstythhccstuvdxjaqxxjldzqefnvervmmskycnjgyhzbclyazxwguzwawtowctyzqsucbrngtcdpjkprgmfjzjqlpvngjcjrsgsvidlwlyeypyjafdxvzeizozkvidtimeonwnjsburseshxkxswfnbnvohkyvjcqnvvfzlkesyvmrutzjhlqtwftmmsanhribbeosyjdetefjkmlxayigpwfvqyzjrvkxikdmaxvxoyyzxgtrogdsdpbxqwbaoqmpkoxpxggzxgfchetpyygackkbulaltkqldbladfkknphazlhkbpycxzzkmfpjvktkxeozajemxzrsizsktcsznxgqpnyqgkbpczqaa" 2421)
30
+
31
+
32
+ (* Grouping test cases *)
33
+ let suite = "Test Suite for answerString" >::: [
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