{ "exercise": "transpose", "version": "1.1.0", "comments": [ "JSON doesn't allow for multi-line strings, so all multi-line input is ", "presented here as arrays of strings. It's up to the test generator to join the ", "lines together with line breaks." ], "cases": [ { "description": "empty string", "property": "transpose", "input": { "lines": [] }, "expected": [] }, { "description": "two characters in a row", "property": "transpose", "input": { "lines": [ "A1" ] }, "expected": [ "A", "1" ] }, { "description": "two characters in a column", "property": "transpose", "input": { "lines": [ "A", "1" ] }, "expected": [ "A1" ] }, { "description": "simple", "property": "transpose", "input": { "lines": [ "ABC", "123" ] }, "expected": [ "A1", "B2", "C3" ] }, { "description": "single line", "property": "transpose", "input": { "lines": ["Single line."] }, "expected": [ "S", "i", "n", "g", "l", "e", " ", "l", "i", "n", "e", "." ] }, { "description": "first line longer than second line", "property": "transpose", "input": { "lines": [ "The fourth line.", "The fifth line." ] }, "expected": [ "TT", "hh", "ee", " ", "ff", "oi", "uf", "rt", "th", "h ", " l", "li", "in", "ne", "e.", "." ] }, { "description": "second line longer than first line", "property": "transpose", "input": { "lines": [ "The first line.", "The second line." ] }, "expected": [ "TT", "hh", "ee", " ", "fs", "ie", "rc", "so", "tn", " d", "l ", "il", "ni", "en", ".e", " ." ] }, { "description": "mixed line length", "property": "transpose", "input": { "lines": [ "The longest line.", "A long line.", "A longer line.", "A line." ] }, "expected": [ "TAAA", "h ", "elll", " ooi", "lnnn", "ogge", "n e.", "glr", "ei ", "snl", "tei", " .n", "l e", "i .", "n", "e", "." ] }, { "description": "square", "property": "transpose", "input": { "lines": [ "HEART", "EMBER", "ABUSE", "RESIN", "TREND" ] }, "expected": [ "HEART", "EMBER", "ABUSE", "RESIN", "TREND" ] }, { "description": "rectangle", "property": "transpose", "input": { "lines": [ "FRACTURE", "OUTLINED", "BLOOMING", "SEPTETTE" ] }, "expected": [ "FOBS", "RULE", "ATOP", "CLOT", "TIME", "UNIT", "RENT", "EDGE" ] }, { "description": "triangle", "property": "transpose", "input": { "lines": [ "T", "EE", "AAA", "SSSS", "EEEEE", "RRRRRR" ] }, "expected": [ "TEASER", " EASER", " ASER", " SER", " ER", " R" ] } ] }