Golang Solution with Explanation
The main idea of this solution is to find the number of columns. The solution comes together pretty quickly after that.\n\nTo explain my thinking to how I found
The main idea of this solution is to find the number of columns. The solution comes together pretty quickly after that.\n\nTo explain my thinking to how I found the number of columns we have to take a matrix. We should know the number rows and columns in that matrix. For example:\n\n`[a][d][g][ ]`\n`[ ][b][e][h]`\n`[ ][ ][c][f]`\n\nWe have a matrix with 3 rows and 4 columns, and 12 items. `3 * 4 = 12`, so if we are given a matrix of size 12 and 3 rows, we can do `12 / 3 = 4` to get the number of columns. Since we know that the number of values in the matrix can be shown using `len(encodedText)` and the problem gives us the number of rows, we can do `len(encodedText) / rows = cols`.\n\nThen all we have to do is add all the letters in a particular order.\n\nNote that `res` is not a `string` because that will output a TLE.\n\n``` go\nfunc decodeCiphertext(encodedText string, rows int) string {\n    n := len(encodedText)\n    cols := n / rows\n    res := []string{}\n    \n    for i := 0; i < cols; i++ {\n        for j := i; j < n; j += cols + 1 {\n            res = append(res, string(encodedText[j]))\n        }\n    }\n    \n    return strings.TrimRight(strings.Join(res, ""), " ")\n}\n```
['Go']