Ad
  • Custom User Avatar

    More examples:

    ['hyuzw', 'oytes', 'xguaq', 'itedx', 'oytes', 'gjphs', 'oytes', 'xsykm', 'tdsza', 'efglo']
    
    'xsykmtdszaefglo' should equal 'gjphsoytesxsykmtdszaefglo'
    
    ['hmmdz', 'pjszx', 'cxjow', 'sfwkz', 'sfwkz', 'pnidi', 'iduwa', 'qctaj', 'wsruv', 'sfwkz', 'zijdf']
    
    'zijdf' should equal 'pnidiiduwaqctajwsruvsfwkzzijdf'
    
  • Custom User Avatar

    Reference solution is definitely wrong:

    ['IjOIj;T"}Ug', '}1xN>Ky?99G[$ 3q3(kru=>0 ', 'IjOIj;T"}Ug', 'IjOIj;T"}Ug', 'IjOIj;T"}Ug', 'IjOIj;T"}Ug', 'IjOIj;T"}Ug']
    
    'IjOIj;T"}Ug' should equal 'IjOIj;T"}Ug}1xN>Ky?99G[$ 3q3(kru=>0 '
    

    The expected value doesn't even loop in the RDS text, so it couldn't be the correct value.

  • Custom User Avatar

    Random tests sometimes do not input any text bits before requesting the concatenated string. This case has never been specified.

  • Custom User Avatar

    I think their point was that you shouldn't do one-liners like this for redability reasons (also, isn't it better to just use the function directly, in real code, instead of redeclaring it just to... Rename it?)

    But from a solution standpoint, this is amazing

  • Custom User Avatar
    test.it("#7")
    rds = RdsConcatenator()
    
    rds.input_rds_text("Hello ")
    rds.input_rds_text("world!")
    rds.input_rds_text("Hello ")
    rds.input_rds_text("world!")
    
    test.assert_equals(rds.get_text(), "Hello world!")
    
    rds.input_rds_text("Hello ")
    rds.input_rds_text("banana, ")
    rds.input_rds_text("potato")
    
    test.assert_equals(rds.get_text(), "banana, potato")
    
    rds.input_rds_text("banana, ")
    rds.input_rds_text("Hello ")
    rds.input_rds_text("world!")
    
    test.assert_equals(rds.get_text(), "Hello world!")
    

    The last suite was not explained in the description

    Other than that, it is not clear what you mean by this:

    Remember, the strings will sometimes repeat, so you wrap have to wrap up somewhere (example 2 and 5).

  • Custom User Avatar

    How is using the standard library instead of reinventing the wheel not best practice?

  • Custom User Avatar

    one person solving it as expected doesn't mean the description is clear enough...

  • 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

    that's better but you still have a part of the rules that is only in the examples.

  • 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

    Ok, that's it. Just explain what is the constraint to clear the list.

    By the way, why the ' not relevant ' thing? Especially with leading/trailing spaces? I don't see the point (or it would require a new argument or function, to pass a list of forbidden informations.)

    EDIT: and don't forget to explain if we are supposed to clear the memo too.

  • 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

    Hi,

    • solution setup is wrong (lacking self in arguments)
    • you should put the specifications before the examples
    • the behavior in the random tests isn't the same than the one in the fixed tests:
      • fixed: a call to get_text is clearing the string
      • rnd: no clearing ever
    • that, or the problem is underspecified about the rules for clearing the string and/or about when/if we have to clear the memo that will make skip some strings
  • Loading more items...