Sort 1250 Discussions, By:
Please Login in order to post a comment
for i in range(c):
short and sweet. that's why you gotta love python
I see a lot of people in the discussions are using a 2d array, did anyone else solve it by simply iterating through the input string? Is there a difference in efficiency? All of my submissions were 0.09s of quicker (using Java). Is there a better way to do it?
why is this happening?
c = math.ceil(math.sqrt(len(s)))
p = ' '.join(map(lambda x: s[x::c], range(c)))
This is the solution i submitted. Can anyone please tell me why ideone is giving correct answer for TestCase 1 and Hackerrank is giving a different answer. No difference in code
TestCase : feedthedog
Ideone output : fto ehg ee dd
Hackerrank editor output : fto ehg ee