a string originalText encode slanted transposition cipher string encodedtext help matrix having fix number row rowsoriginalText place topleft bottomright mannerthe blue cell fill follow red cell yellow cell reach end originalText the arrow indicate order cell fill all cell fill the number column choose rightmost column fill originaltextencodedtext form append character matrix rowwise fashionthe character blue cell append encodedText red cell finally yellow cell the arrow indicate order cell accessedfor example originalText cipher row 3 encode follow mannerthe blue arrow depict originalText place matrix red arrow denote order encodedtext form in example encodedtext ch ie prgiven encode string encodedtext number row row return original string originalTextNote originaltext trail space the test case generate possible originalText example 1input encodedText ch ie pr row 3output cipherExplanation this example describe problem descriptionExample 2input encodedText iveo eed l te olc row 4Output love leetcodeexplanation the figure denote matrix encode originalText the blue arrow find originaltext encodedtextexample 3input encodedtext code row 1output codingexplanation since 1 row originalText encodedText constraints0 encodedtextlength 106encodedtext consist lowercase english letter onlyencodedtext valid encode originaltext trail spaces1 row 1000the testcase generate possible originaltext