• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
utlumurat Avatar
Name:Murat UTLU
Clan:Unknown
Member Since:Jul 2020
Last Seen:Sep 2021
Profiles:
Following:6
Followers:1
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (16)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • dookie_shoes
    • commented on "Recover a secret string from random triplets" python solution
    • 2 years ago

    Honestly I couldn't figure this out on my own but when I attempted it - sometimes it would complete and sometimes it would fail.

    I came up with a cheat by putting the for loop in a function and running it under a while loop.
    If the function doesn't return the same string as before it will run again until it returns the same string as it did before.

  • Custom User Avatar
    • 4500zenja1
    • resolved a suggestion on "Unexpected parsing" kata
    • 2 years ago

    I do believe the description has been changed and improved since your post, so I can close this suggestion. Thanks for noting that out :)

  • Custom User Avatar
    • Thedon989
    • commented on "Recover a secret string from random triplets" python solution
    • 3 years ago

    Since the triplets are random you can get inaccurate results only parsing over the triplets once. Puayny is correct in their comment "This solution is incomplete though elegant, it will fail for some test cases currently not included. The 'for l in triplets' loop shouldn't run just once, it should run until there are no more swaps.". Their comment is the most efficient solution however since these are triples you could also just run the loop twice which I think is more than enough to get the correct sequence.

  • Custom User Avatar
    • malegkin
    • commented on "Recover a secret string from random triplets" python solution
    • 3 years ago

    you have the wrong solution
    if we check it on all possible triplets permutation for first test, then as a secrets we get

    defaultdict(<class 'int'>, {'whatisup': 2565, 'tuwhapis': 120, 'uwhatpis': 76, 'twhapisu': 240, 'twhuapis': 6, 'twhapuis': 26, 'whatupis': 79, 'whatpisu': 660, 'whuatpis': 9, 'whatpuis': 16, 'twhaisup': 180, 'twhaupis': 28, 'whatipsu': 285, 'wuhatisp': 35, 'wuhiatsp': 88, 'whiuatsp': 71, 'whiatsup': 195, 'whuatisp': 18, 'whuiatsp': 10, 'uwhatisp': 7, 'uwhiatsp': 11, 'whatiusp': 30, 'whatuisp': 30, 'whiatusp': 60, 'twhiapsu': 60, 'whiatpsu': 75, 'twhiasup': 60})

  • Custom User Avatar
    • LesRamer
    • commented on "Recover a secret string from random triplets" python solution
    • 3 years ago

    I recommend using a set comprehension:

    {c for t in triplets for c in t}
    

    Besides being more terse, this doesn't build an extra list temporary.

  • Custom User Avatar
    • StarryVoid
    • commented on "Recover a secret string from random triplets" python solution
    • 4 years ago

    is wrong
    on python 3.8

  • Custom User Avatar
    • xiongli520
    • commented on "Recover a secret string from random triplets" python solution
    • 4 years ago

    its wrong

  • Custom User Avatar
    • Jarjar1349
    • commented on "Recover a secret string from random triplets" python solution
    • 5 years ago

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

  • Custom User Avatar
    • Jarjar1349
    • commented on "Recover a secret string from random triplets" python solution
    • 5 years ago

    I think a generalized version of this solution that runs multiple passes and stops only when 'r' remains unchanged for two passes would be a good answer. I made a rough implementation here https://www.codewars.com/kata/reviews/53fbcb9ecfc5f67703000032/groups/5ff218e51d40250001bac79a

  • Custom User Avatar
    • konkrer
    • commented on "Recover a secret string from random triplets" python solution
    • 5 years ago

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

  • Custom User Avatar
    • CodingBono
    • commented on "Recover a secret string from random triplets" python solution
    • 5 years ago

    Can you please explain me what exactly changed in Python 3 which makes the solution break?

  • Custom User Avatar
    • utlumurat
    • created a question for "Invalid Login - Bug Fixing #11" kata
    • 5 years ago

    What is the purpose of this kata?

  • Custom User Avatar
    • utlumurat
    • created a suggestion for "Unexpected parsing" kata
    • 5 years ago

    I wonder who accepts this kind of katas. Description should be improved.

  • Custom User Avatar
    • utlumurat
    • commented on "Evil or Odious" kata
    • 5 years ago

    Poor description

  • Custom User Avatar
    • utlumurat
    • commented on "The old switcheroo" python solution
    • 5 years ago

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

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...