Ad
  • Custom User Avatar

    0 is not a prime number.

    Not a kata issue. Closing.

  • Custom User Avatar

    Tax is a rate you must pay as a percentage of your earnings. Your invested savings themselves are not included in the tax calculation, only the earnings made from the interest. If, in a given year, you earn $100, a tax rate of 20% (0.2) would mean $20 must be paid as tax. Your invested savings would increase by $80 that year.

  • Custom User Avatar

    That's too big; remember that you have to return to your starting point.

  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar

    When I made my code I used the algorithim sieve of erostheneas, and I noticed something about this test case assertEquals(7,Solution.solve(new int [] {1,2,3,4}));
    it's wrong. The prime indexes are 0, 2, 3 the values of those indexes is 1, 3, 4 when added together..the result is 8 not 7. This is an issue is there a misunderstanding
    of the rules?

    There's a similar issue with this test case(it's one of the sample ones) assertEquals(14,Solution.solve(new int [] {1,2,3,4,5,6}));
    here's a screeen shot proving that this specific test case is wrong.

    https://imgur.com/a/S88fKSX

    Actually this is a problem with the last sample test case also.

  • Custom User Avatar

    Thanks for your code.

    If you want to see the test cases, you can do that after finishing or forfeiting the kata. :-)

    I tried out your code and I couldn't recreated the problems with the test cases.

    That being said, your code does not completely solve the task. As a hint, try merging "ab" and "bc" to "abcb". It should work.

    (Also, as a side note, if you want to use Java in a bigger context, the convention is that local variables start with a lower-case letter, e.g. mergeWord. It doesn't make any technical difference, so if you're just doing it for fun, you can disregard this. :-) )

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    assertTrue("'Can we merge it? Yes, we can!' is a merge of 'an e mrgite, we a!' and 'Cwee ? Yscn'", StringMerger.isMerge("'Can we merge it? Yes, we can!' ", "'an e mrgite, we a!'", "'CnwemrgtYescn' "));

    This test case is wrong....... as the order is messed up and the string length doesn't queal the length of part1+part2 making it impossible to merge correctly.

  • Custom User Avatar

    I see I assummed I was nit just counting the number of characters that repeat, but also the number od times I assumed that was somewhat implicit my bad.

    I shoukd be able to easily fix this.

    My code logic was wrong.....

  • Custom User Avatar

    The test is ok, your code is not. The expected result is ok, there are 3 repeated letters, a, b and c, it doesn't matter how many times each letter is repeated.

  • Custom User Avatar

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

  • Custom User Avatar

    How does the tax work tell me the math behind these intructions I don't understand these intruction plz explain them.

  • Custom User Avatar

    No, you changed the method name. It should be 'squareDigits', not 'squareDigit'. The issue comes from your code, not kata itself.

  • Custom User Avatar

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

  • Loading more items...