Ad
  • Custom User Avatar

    Yeah, but I don't really know how to put it, I'll try some things. But on the other end, there's someone that has achieved it, so that's a good start.

  • Custom User Avatar

    Yay! someone finally understood my kata! And you have the same solution as me line by line (it's just the variables that change)!

  • Custom User Avatar

    ' not relevant ' is there to point out that if a text repeats, what has come before doesn't matter, see my edit as I added comments to the examples.

    Also I don't understand the memo thing, try reading the comments I made, see if you can understand.

  • Custom User Avatar

    I think I see now what you mean:

    rds.input_rds_text("music ")
    rds.input_rds_text("#1")
    rds.input_rds_text("music ")
    
    print(rds.get_text())
    
    rds.input_rds_text("song ")
    rds.input_rds_text("#2 ")
    
    print(rds.get_text())
    
    # returns
    # >>> music #1
    # >>> song #2
    

    The 1st get_text() doesn't clear the list, it's just that the first three lines will make the concatenator realise the text loops (*music * and #1). So in the list, music and #1 are stored and when get_text() is called, it returns that.

    But on the 4th input, it receives something that isn't in the list ("song" not in ["music ", "#1"]), so it clears that, and starts a new list containing "song "

    I edited this example by adding a rds.input_rds_text("#1") after the first the get_text().

    What I may do is add comments in the examples to explain them.

  • Custom User Avatar

    Hello, I fixed:

    1. the initial solution problem (thx to pointing out that typo)

    2. moved the position of the specs

    As for the other one, I don't really understand, as the random cases are made by implementing a solution that works with the fixed cases. I think it's probably a problem with me not explaining the algorithm correctly. I'm trying to wrap my head around a way to explain it simply (the difficulty of explaining is why I mainly used examples). I'll try to find ways to better explain the problem (already added a part, see if that helps).

  • Custom User Avatar

    Absolutely not best practice, but super clever!