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.
actually there is problem with time complexity, since in this code, you need to call count function(O(n) complexity) for every generated face
OP solved it, closing
The arrarys can improve readability, the only problem is that O(n) has a bigger constant.
the problem is... python. It's too much of "battery included" (see below).
This comment is hidden because it contains spoiler information about the solution
A delimiter is a character that separates values so that you know each one is separate from another one. A delimiter can be any character, but it is most commonly: a comma (","); a colon (":"); a space (" "); a semicolon(";") or a dash ("-").
The split function separates value by their delimiter, you have put the delimiter as a comma even though the delimiter is a space. An example is:
-1 50 -4 20 22 -7 0 10 -8
where you can see each value is split by a space. Since you put the delimiter as a comma, the split function will look for the comma character in order to separate each value, however there is none so it just gives a list of length 1.The delimiter is a space character, not a comma - change .split(',') to .split(' ')
You are using Python 2.7.6 which makes use of integer divison where division results are floored (1/2 returns 0 instead of 0.5 because 0.5 floored is 0). You can fix this by stating it should be float divison (add a decimal point to one of the numbers - 1./2 or 1/2.) or you can change the Python version to Python3 which uses float divison by default and not integer division.