We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I didn't use floor at all. x,y = 0,ceil, then take chunks of s[x:y], adding ceil to x and y each time. But as someone mentioned above, you don't have to create this matrix, since the string would be s[0] + s[ceil] + s[2*ceil] etc., add a space, then do it again starting at s[1]+s[1+ceil], etc.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Encryption
You are viewing a single comment's thread. Return to all comments →
I didn't use floor at all. x,y = 0,ceil, then take chunks of s[x:y], adding ceil to x and y each time. But as someone mentioned above, you don't have to create this matrix, since the string would be s[0] + s[ceil] + s[2*ceil] etc., add a space, then do it again starting at s[1]+s[1+ceil], etc.