-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproblems11_20.js
156 lines (147 loc) · 4.27 KB
/
problems11_20.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
test_11 = [
"firstLast6([1, 2, 6])",
"firstLast6([6, 1, 2, 3])",
"firstLast6([13, 6, 1, 2, 3])",
"firstLast6([13, 6, 1, 2, 6])",
"firstLast6([3, 2, 1])",
"firstLast6([3, 6, 1])",
"firstLast6([3, 6])",
"firstLast6([6])",
"firstLast6([3])",
"firstLast6([5, 6])",
"firstLast6([5, 5])",
"firstLast6([1, 2, 3, 4, 6])",
"firstLast6([1, 2, 3, 4])"
];
answer_11 = [true,true,false,true,false,false,true,true,false,true,false,true,false];
test_12 = [
"has23([2, 5])",
"has23([4, 3])",
"has23([4, 5])",
"has23([2, 2])",
"has23([3, 2])",
"has23([3, 3])",
"has23([7, 7])",
"has23([3, 9])",
"has23([9, 5])"
];
answer_12 = [true,true,false,true,true,true,false,true,false];
test_13 = [
"fix23([1, 2, 3])",
"fix23([2, 3, 5])",
"fix23([1, 2, 1])",
"fix23([3, 2, 1])",
"fix23([2, 2, 3])",
"fix23([2, 3, 3])"
];
answer_13 = [[1, 2, 0],[2, 0, 5],[1, 2, 1],[3, 2, 1],[2, 2, 0],[2, 0, 3]]
test_14 = [
"countYZ('fez day')",
"countYZ('day fez')",
"countYZ('day fyyyz')",
"countYZ('day yak')",
"countYZ('day:yak')",
"countYZ('!!day--yaz!!')",
"countYZ('yak zak')",
"countYZ('DAY abc XYZ')",
"countYZ('aaz yyz my')",
"countYZ('y2bz')",
"countYZ('zxyx')"
];
answer_14 = [2,2,2,1,0,0,0,2,3,1,0]
test_15 = [
'endOther("Hiabc", "abc")',
'endOther("AbC", "HiaBc")',
'endOther("abc", "abXabc")',
'endOther("Hiabc", "abcd")',
'endOther("Hiabc", "bc")',
'endOther("Hiabcx", "bc")',
'endOther("abc", "abc")',
'endOther("xyz", "12xyz")',
'endOther("yz", "12xz")',
'endOther("Z", "12xz")',
'endOther("12", "12")',
'endOther("ab", "ab12")',
'endOther("ab", "12ab")',
'endOther("abcXYZ", "abcDEF")'
];
answer_15 = [true,true,true,false,true,false,true,true,false,true,true,false,true,false];
test_16 = [
'starOut("ab*cd")',
'starOut("ab**cd")',
'starOut("sm*eilly")',
'starOut("sm*eil*ly")',
'starOut("sm**eil*ly")',
'starOut("sm***eil*ly")',
'starOut("stringy*")',
'starOut("*stringy")',
'starOut("*str*in*gy")',
'starOut("abc")',
'starOut("a*b")',
'starOut("ab")',
'starOut("a*b")',
'starOut("a")',
'starOut("a*")',
'starOut("*a")',
'starOut("*")',
'starOut("")'
];
answer_16 = ["ad","ad","silly","siy","siy","siy","string","tringy","ty","abc","","ab","","a","","","",""];
test_17 = [
'getSandwich("breadjambread")',
'getSandwich("xxbreadjambreadyy")',
'getSandwich("xxbreadyy")',
'getSandwich("xxbreadbreadjambreadyy")',
'getSandwich("breadAbread")',
'getSandwich("breadbread")',
'getSandwich("abcbreaz")',
'getSandwich("xyz")',
'getSandwich("")',
'getSandwich("breadbreaxbread")',
'getSandwich("breaxbreadybread")',
'getSandwich("breadbreadbreadbread")'
];
answer_17 = ["jam","jam","","breadjam","A","","","","","breax","y","breadbread"];
test_18 = [
"canBalance([1, 1, 1, 2, 1])",
"canBalance([2, 1, 1, 2, 1])",
"canBalance([10, 10])",
"canBalance([10, 0, 1, -1, 10])",
"canBalance([1, 1, 1, 1, 4])",
"canBalance([2, 1, 1, 1, 4])",
"canBalance([2, 3, 4, 1, 2])",
"canBalance([1, 2, 3, 1, 0, 2, 3])",
"canBalance([1, 2, 3, 1, 0, 1, 3])",
"canBalance([1])",
"canBalance([1, 1, 1, 2, 1])"
];
answer_18 = [true,false,true,true,true,false,false,true,false,false,true];
test_19 = [
'countClumps([1, 2, 2, 3, 4, 4])',
'countClumps([1, 1, 2, 1, 1])',
'countClumps([1, 1, 1, 1, 1])',
'countClumps([1, 2, 3])',
'countClumps([2, 2, 1, 1, 1, 2, 1, 1, 2, 2])',
'countClumps([0, 2, 2, 1, 1, 1, 2, 1, 1, 2, 2])',
'countClumps([0, 0, 2, 2, 1, 1, 1, 2, 1, 1, 2, 2])',
'countClumps([0, 0, 0, 2, 2, 1, 1, 1, 2, 1, 1, 2, 2])',
'countClumps([])'
];
answer_19 = [2,2,1,0,4,4,5,5,0];
test_20 = [
'evenlySpaced(2, 4, 6)',
'evenlySpaced(4, 6, 2)',
'evenlySpaced(4, 6, 3)',
'evenlySpaced(6, 2, 4)',
'evenlySpaced(6, 2, 8)',
'evenlySpaced(2, 2, 2)',
'evenlySpaced(2, 2, 3)',
'evenlySpaced(9, 10, 11)',
'evenlySpaced(10, 9, 11)',
'evenlySpaced(10, 9, 9)',
'evenlySpaced(2, 4, 4)',
'evenlySpaced(2, 2, 4)',
'evenlySpaced(3, 6, 12)',
'evenlySpaced(12, 3, 6)'
];
answer_20 = [true,true,false,true,false,true,false,true,true,false,false,false,false,false];