• ###### iliveinaflyingcastlecommented on "Recover a secret string from random triplets" python solution

letters is a list of all the different letters in the string, and the for loop is just repeatedly looking a the triplets
eg. if triplets=[[1,2],[3,4]] then letters is a list containing 1,2,3,4 in any order, and t will be [1,2] and [3,4], 4 times each

• ###### GeorgeRJacobscommented on "Recover a secret string from random triplets" python solution

So I agree that your solution works ( I didn't get the answer right myself ), and this is great stuff. I guess the answer to your question about the loops is the fact that there wasn't a guarantee (at first viewing) that looping thru just once would guarantee the optimal solution.

• ###### bcnycommented on "Recover a secret string from random triplets" python solution

Great solution. I am a beginner in computer science can someone please confirm that the time complexity is O(3n * len(letters)) and if not could you explain me why? Many thanks

• ###### juliango202commented on "Upside-Down Numbers - Challenge Edition" kata

Thanks for this kata. I found it very challenging to keep track of whether starting zeros are OK or not, depending on where we are in the computation. I wonder if I missed an obvious optimization.

• ###### docgunthropcommented on "Interlaced Spiral Cipher" kata

Yes, there is a similarity there. That one didn't show up when I was searching for possible duplicates before publishing. However, it appears there are significant differences that distinguish between the two so they wouldn't be duplicates.

• ###### juliango202commented on "Interlaced Spiral Cipher" kata

It's a nice kata but I found it quite difficult to understand the instructions. I prefer very simple instructions that give rise to a difficult problem :) But still thanks for this!

• ###### docgunthropcommented on "Interlaced Spiral Cipher" kata

Is the "somewhat satisfied" vote due to the ranking? Because I have no control over that.

• ###### juliango202commented on "Interlaced Spiral Cipher" kata

I think this is harder than 5-kyu

nice! ;)

• ###### Udusecommented on "Recover a secret string from random triplets" python solution

This comment is hidden because it contains spoiler information about the solution

• ###### 8fdafs2commented on "Recover a secret string from random triplets" python solution

How about reducing the numbers of loop: len(letters) to its half?

• ###### escootcommented on "Recover a secret string from random triplets" python solution

I have absolutely no background in programming I had just learnt python from codecademy.com and somehow came across codewars to practise what I have learnt. I managed to reach 5kyu, so this question may sound silly but can someone explain the 2nd and 3rd line of the code, what does it exactly do?

• ###### varunbpatilcommented on "Recover a secret string from random triplets" python solution

Can anybody explain to me why the outer for-loop loops len(letter) times ?
Is it because each iteration through the outer for loop decides the final position of exactly one letter ?

My solution is similar except that I just kept the outer for loop going until the inner for loop resulted in no swaps at all.