Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
0
is not a prime number.Not a kata issue. Closing.
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.
That's too big; remember that you have to return to your starting point.
OP solved it, closing
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.
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. :-) )This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
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.
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.....
The test is ok, your code is not. The expected result is ok, there are 3 repeated letters,
a
,b
andc
, it doesn't matter how many times each letter is repeated.This comment is hidden because it contains spoiler information about the solution
How does the tax work tell me the math behind these intructions I don't understand these intruction plz explain them.
No, you changed the method name. It should be 'squareDigits', not 'squareDigit'. The issue comes from your code, not kata itself.
This comment is hidden because it contains spoiler information about the solution
Loading more items...