Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
( JS )
Custom failure messages do not add to default failure messages. Inputs are already in
it
-headers, so custom messages are just not necessary.( JS )
User solution is called outside
it
, which means logging is detached from testing.( JS )
Random tests are vulnerable to input modification
When I understood, I did it! Thanks!
A lot of the testsomething random are worng.
The array:
1
2
3
4
5
6
7
8
9
10
53
11
32
25
96
82
47
28
6
63
87
66
7
40
72
58
46
45
33
63
56
8
47
16
11
0
8
92
92
50
50
46
97
70
10
47
45
27
10
13
Should return [10, 49] as the 10 first positions are correct but from the 10th to the 49th are not, well [0, 49] was expected.
Happened again. Array:
1
2
3
4
5
6
7
8
9
10
74
9
52
43
70
48
72
92
23
66
67
52
14
1
57
43
15
33
48
86
42
43
49
32
65
33
42
15
4
58
23
55
48
73
62
14
25
1
72
92
Should be [10, 49], but expected [1, 49] it even makes less sense than before
Once again:
1
2
3
4
5
6
7
8
9
10
44
13
11
46
19
66
98
19
84
25
40
95
25
83
36
49
11
89
91
14
36
85
31
2
57
44
22
92
19
10
72
38
4
49
87
78
46
47
18
3
[2, 49] was expected, is it something that I am not understanding?
Another:
1
2
3
4
5
6
7
8
9
10
64
80
47
80
52
20
27
81
27
25
99
48
62
47
65
58
89
72
52
50
77
73
22
37
14
26
35
82
42
16
68
34
15
36
65
34
38
41
28
9
[9, 49] expected, who made this?
I can keep going, the make lense sense everytime I try, it is the only test I am failing:
1
2
3
4
5
6
7
8
9
10
91
86
37
85
43
30
34
24
50
41
23
32
51
69
70
30
48
70
93
36
52
67
76
27
37
91
97
70
96
53
72
32
54
5
42
59
63
94
66
92
[5, 49] expected, is the first number just a random number or what?
This comment is hidden because it contains spoiler information about the solution
Python Translation for review / approval
TypeScript Translation for review / approval
CoffeeScript Translation for review / approval
The author hasn't been active for quite a while. Reworded the description a bit on this one, not sure if that's OK?
A few littles typos in the description:
.., with this sorted subarray re[P]lacing original subarray, ..
The function accept[S] an array of integers, arr, re[TU]rn the subarray's ..
Thanks Voile
Approved
Thanks for the suggestion:-) java just added
translate it to other language and waiting for warriors to solve it ;-)
@myjinxin2015, I stole some of you guys' ideas to create very similar solution. Btw, would you please advice how can i get this kata out of beta version please? thanks in advance!
Yup, cheers!
You can using
Test.assertDeepEquals
method to verify thearray
object.Test.assertDeepEquals(results1,corrects, "Should return "+JSON.stringify(corrects));
And you can put your random test into a for loop.
Loading more items...