Ad
  • Default User Avatar

    Woah, I didn't know you can send picture in comment section.

  • Custom User Avatar

    That's true. A lot of solutions (including me) extended the initial array just to return the final value of the iteration, which seeing this kind of solution, seems very inneficient and unnecessary.

  • Default User Avatar

    Yes I agree with goodwin64.The adjustment is not enough for the method

  • Custom User Avatar

    ...which is still much better than creating an array of length n, just to return the last value.

  • Default User Avatar

    Print out the results and think about why you are getting that number!

  • Custom User Avatar

    the same trouble

  • Custom User Avatar

    You can imagine that the author is your boss ;-)
    He always had some strange requests. Such as reverse a string, making a palindrome string, count the vowel characters...
    All you can do is output data as required, and don't complain about why it's not a different format. Hahaha! :D:D:D

  • Custom User Avatar

    Also, use the string to verify the answer is more convenient than using an array of verification, with little time to convert an array of strings

    Why is that? assertSimilar works well for arrays.

  • Custom User Avatar

    Two corrections.

    If the principal is already greater than or equal to the desired, the function SHOULD return 0. It's even mentioned in the instructions.

    Second - this should be greater than or equal to, not just equal to

  • Default User Avatar

    kyu and tags (I put only Fundamentals) were given by a moderator not by the author.

  • Default User Avatar

    Except brute force DOES work. On my hardware, you have to use parameters in the 100,000 range before it takes a minute. 10,000 is done in 5 seconds. As is, this is a 7 or 8 kyu. If you want it to be a 4 kyu, all that needs to be done is to add test cases where the brute force times out the server and you have to optimize to have a complete solution.

  • Default User Avatar

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

  • Custom User Avatar

    Translated your kata into Ruby and you have another translation pending: if you wish to approve both, then I can edit it (if I do it before we would get merge errors) to see if I can produce what you wish for :)

  • Custom User Avatar
  • Custom User Avatar

    Even if you submit? Because I just checked the tests in Python and found not "£" whatsoever.

    Sample test code do not update once I chanage the code; if you wish, just copy&paste:

    Test.describe("Basic tests")
    Test.assert_equals(rad_ladies("k?%35a&&/y@@@5599 m93753&$$$c$n///79u??@@%l?975$t?%5y%&$3$1!"), 'KAY MCNULTY!')
    Test.assert_equals(rad_ladies("9?9?9?m335%$@a791%&$r$$$l@53$&y&n%$5@ $5577w&7e931%s$c$o%%%f351f??%!%%"), 'MARLYN WESCOFF!')
    Test.assert_equals(rad_ladies("%&$557f953//1/$@%r%935$$a@3111$@???%n???5 $%157b%///$i%55&31@l?%&$$a%@$s5757!$$%%%%53"), 'FRAN BILAS!')
    Test.assert_equals(rad_ladies("///$%&$553791r357%??@$%u?$%@7993111@$%t$h3% 3$l$311i3%@?&c3h%&t&&?%11e%$?@11957r79%&m$$a55n1!111%%"), 'RUTH LICHTERMAN!')
    Test.assert_equals(rad_ladies("??@%&a5d15??e599713%l%%e%75913 1$%&@g@%o&$@13l5d11s$%&t15i9n&5%%@%e@$!%$"), 'ADELE GOLDSTINE!')
    
  • Loading more items...