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.
Question for the Java implementation the Second performance test seems to expect the wrong result, I printed and copied the ~60000 character strings into my IDE.
I performed the Unit Test with the expected result of codewars, my method removed 5999X characters and only the spare characters of the longer String were left, this indicates that the Strings seem to match with each other so scrambles should return true.
After adding a random character which is not part of the leftover characters, my scarmble returned the expected false after 58XXX chars were removed.
Can someone verify this?
I Tested my Code with these Tests:
@Test(expected=NodeException.class)
public void NodeTest(){
assertEquals(BigInteger.valueOf(0), Cable.calculateLength("a"));
}
@Test(expected=BracketException.class)
public void BracketTest() {
assertEquals(BigInteger.valueOf(0), Cable.calculateLength("(()"));
}
@Test(expected=BracketException.class)
public void BracketTest2() {
assertEquals(BigInteger.valueOf(0), Cable.calculateLength("(())))"));
}
and obviously the Given Tests, when I try to compile the solution I get that stacktrace:
olutionTest.java:89: error: cannot find symbol
private BigInteger calculateLengthSolution(String cable) throws BracketException, NodeException{
^
symbol: class NodeException
location: class SolutionTest
SolutionTest.java:25: error: cannot find symbol
@Test(expected=BracketException.class)
It seems like the compiler cannot find my defined exceptions even though he finds them in my IDE
I am Sorry to bother you but Error Messages are still the same for me. Is the fix pushed allready?
This comment is hidden because it contains spoiler information about the solution
I am kinda confused by this output: SolutionTest.java:89: error: cannot find symbol
private BigInteger calculateLengthSolution(String cable) throws BracketException, NodeException{
Isn't our method called calculateLength ?
Also what should be the output when the excpetions are thrown? I assumed you set the result to 0;
SampleTest run smooth in 10ms