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.
One of the random tests on C++ is test tX, original Tx, expects true. I think this should be false.
The description says anagrams are case insensitive. Apply case insensitivity to Tx and tX means they are the same word and not different.
You should print the input lists at the beginning of the function to see where it fails. See https://docs.codewars.com/training/troubleshooting/#print-input
It's currently failing with some negative numbers in
array1
.Hi,
Thanks for this challenge. However, I encounter a problem, I pass all the tests except one case where I should have True but I have False. Would these come from my code?
Thanks for your answers :)
How can I be sure about exactly which test I am failing. The output is:
Time: 3288ms Passed: 1 Failed: 1 Exit code 1
Test_Results
Comp_Tests
Tests_comp
! Expected: true
Actual: false
Random_tests
When i print the inputs it seems like the failure is for input (2,2,3) and (4,9,9) but based on a look through the discussions it looks like this might not be the case? For other Kata a test number is given for each test and a pass or fail output against each.
Great answer - it helped a lot. Instructions clear and easy to follow. I solved the problem and passed all tests. Thanks :)
Ideally, failed tests would present the input which made them fail. But if they do not, you can try this: https://docs.codewars.com/training/training-example#debugging-a-kata
how do I find out what the inputs were for a failed test? I have submitted a solution in C++ for 'common denominators' and have failed test 3 with output:
Expected: equal to "(77033412951888085,14949283383840498)(117787497858828,14949283383840498)(2526695441399712,14949283383840498)" Actual: "(3414707982693751,14949283383840498)(1573009032312,14949283383840498)(1612068318217,14949283383840498)"
For the error message ValueError: invalid literal for int() with base 10, I tried Python's
try: except ValueError: pass
which worked.
However, I am no stuck with:
Input: 't"expEXXk67748NaX2D825897348000089'
Output says my output:
't"epEXXk100' should equal 't"epEXXk100'
I really could do with some help on this one. Any help welcome.
On running sample tests the output says that my code returns [('a',)] should be ['a']. Running my code from windows powershell using both python 2.7 and 3.6 I get out put of ['a'] for an input string of 'a'. Same thing if I run my code using spyder and python 3.6.
Also I believe somehow you can print what the input was for the test condition that produced the failed output but I cannot see how to do this.
Help would be most welcome. Thanks.
OK thanks I did not realise that. Not sure how I can print the input. I have not seen how to do this. In the meantime I have been logged out so it seems I have lost the chance to complete the kata.
[[1, 2], [0, 2], [0, 2]]
is what your solution returned. If you want to see the input, you can print it.This comment is hidden because it contains spoiler information about the solution
All correct, but the test input is
987654310
.Cheers :)
Hello Giacomo,
Thanks for replying.
I recognise that the instruction states "the next bigger number formed by the same digits" as opposed to "the next bigger number compared to the test input". Even so the next bigger number formed by the same digits as 9876543102 is I believe 9876543120. It uses the same digits as the input and is the next biggest number using those digits. In other words there is a possible combination of the given digits that gives a bigger number which is the next biggest - the number I output is next biggest compared to the input. The "should equal -1" given back as output implies that, using the words in the instructions "no bigger number can be composed using those digits". Besides, in order to make sense of "next" biggest is it not a requirement that "next to what" is known.
Again why does output give: '21' (in single quotation marks) should equal 21 mean?
It is not the next greatest compared to the test input...
Loading more items...