File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed
exercises/practice/transpose Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 19
19
},
20
20
"blurb" : " Take input text and output it transposed." ,
21
21
"source" : " Reddit r/dailyprogrammer challenge #270 [Easy]." ,
22
- "source_url" : " https://www. reddit.com/r/dailyprogrammer/comments/4msu2x/challenge_270_easy_transpose_the_input_text"
22
+ "source_url" : " https://web.archive.org/web/20230630051421/https://old. reddit.com/r/dailyprogrammer/comments/4msu2x/challenge_270_easy_transpose_the_input_text/ "
23
23
}
Original file line number Diff line number Diff line change 1
- # This is an auto-generated file. Regular comments will be removed when this
2
- # file is regenerated. Regenerating will not touch any manually added keys,
3
- # so comments can be added in a "comment" key.
1
+ # This is an auto-generated file.
2
+ #
3
+ # Regenerating this file via `configlet sync` will:
4
+ # - Recreate every `description` key/value pair
5
+ # - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6
+ # - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7
+ # - Preserve any other key/value pair
8
+ #
9
+ # As user-added comments (using the # character) will be removed when this file
10
+ # is regenerated, comments can be added via a `comment` key.
4
11
5
12
[404b7262-c050-4df0-a2a2-0cb06cd6a821 ]
6
13
description = " empty string"
@@ -34,3 +41,6 @@ description = "rectangle"
34
41
35
42
[b80badc9-057e-4543-bd07-ce1296a1ea2c ]
36
43
description = " triangle"
44
+
45
+ [76acfd50-5596-4d05-89f1-5116328a7dd9 ]
46
+ description = " jagged triangle"
Original file line number Diff line number Diff line change @@ -193,5 +193,24 @@ describe('transpose', function()
193
193
194
194
assert .are .equal (expected , transpose (input ))
195
195
end )
196
+
197
+ it (' should transpose a jagged triangle' , function ()
198
+ local input =
199
+ ' 11\n ' ..
200
+ ' 2\n ' ..
201
+ ' 3333\n ' ..
202
+ ' 444\n ' ..
203
+ ' 555555\n ' ..
204
+ ' 66666'
205
+ local expected =
206
+ ' 123456\n ' ..
207
+ ' 1 3456\n ' ..
208
+ ' 3456\n ' ..
209
+ ' 3 56\n ' ..
210
+ ' 56\n ' ..
211
+ ' 5'
212
+
213
+ assert .are .equal (expected , transpose (input ))
214
+ end )
196
215
end )
197
216
-- LuaFormatter on
You can’t perform that action at this time.
0 commit comments