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.
"Idk why my solution is not working" is not an issue.
It is about the way you're creating OrderedDict's.
OrderedDict is a dictionary where keys maintain the order in which they are inserted.
That means, you have to create OrderedDict, by giving it keys in the order you want them to stay.
Try to use for loop to do this.
When you solve this, rest of your code should be working with Python 2.7.6.
No Issue in this case.
Godspeed mate!
I would suggest trying to go about another approach. Wrong or right (obviously it is wrong) this code would not fare well in an interview due to readability and being overly complex. Keep up the effort :)
Print the input and you'll see what cases you're failing.
Attempt the kata instead of trying the sample tests.
First is there in case there is more than one string (or consecutive strings) with the same length.
What are you talking about?
"oocccffuucccjjjkkkjyyyeehh"
is the longest string.Your solution is wrong.
Not a suggestion.
Check second to last column, two 3, no 5. And the last column has two 5 and no 3.
@ofeks: look at the last digit of the last subarray, from top to bottom, you can see there are two 9 there and no 3.
thing is: your logs are a total mess. Print the input, just the input.
And how is this helpful in debugging a solution to a task where element order is crucial?
There're duplicate elements in the columns.
Why not?
The log appears above the test result.
Use
print(dice)
and you'll see why your code fails. In fact it is failing with one of the examples:The first two keys of the dict are numbers instead of strings. You'll have to figure out some other problems too.
Loading more items...