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.
HALT is typically considered a separate state. I think you should explicitly mention that kata does not consider it as a separate state. Because techinally, the 1 state machines you provided as an example are acctually 2 state machines: 1 "actual" state and HALT.
Python: description must be language specific.
BigInt
is not python-specific and needs to be replaced with justint
There's an inconsistency in terms you use. In the title it's length, in description it's number of rules. I suggest you change the title to "Count number of Turing Machines with N rules". There's no such thing as a turing machine program, it only has rules.
Python Translation
This comment is hidden because it contains spoiler information about the solution
Haskell translation
This comment is hidden because it contains spoiler information about the solution
Python:
Missing corresponding imports
Missing
it
block in sample and fixed testsVariable names for tests are shadowing built-in functions
This comment is hidden because it contains spoiler information about the solution
First, English uses
amount
for the sort of quantities for which you would use real (floating point) numbers. For traditionally countable things, or units of continuously variable things, use the wordnumber
. (Examples: an amount of water, a number of bottles of water, an amount of rain, a number of centimeters of rain, a number of raindrops, etc.) As an aside, the same distinction applies to how much vs. how many, with many corresponding to a number.Second, "the number of times you've already seen it" starts at zero. because "have already" implies the exclusion of this time. OK, you specifically force the first time to get a
1
, but the second time it appears, I have already seen it just once, and yet you expect a2
. It's possibly confusing. From the examples, it becomes obvious, but then also it appears that the distinction between the first occurrence and every following occurrence is unnecessary. The line becomes consistent and agrees with the examples if you only change it to:and/or something such as
then the examples make clear it means 1-indexed and not 0-indexed.
Прохожу тесты, выводя время выполнения каждого из них, суммирую все полученные значения, получаю 9224. CodeWars даёт: Execution Timed Out (16000 ms), почему 9224 == 16 000 и почему так не считают зарплату? Решал на java
I found some testcases, where the Codewars environment shows different results than my program:
number of walls: 6
walls = (
[ (Point(6, 2),Point(7, 1))
, (Point(7, 4),Point(6, 3))
, (Point(1, 2),Point(3, 0))
, (Point(2, 1),Point(0, 3))
, (Point(9, 1),Point(8, 2))
, (Point(6, 4),Point(7, 5))
])
width = 10
height = 5
expected = False
Your answer: True
Here the 2 overlapping edges (Point(1, 2),Point(3, 0)) and (Point(2, 1),Point(0, 3)) form a partition with upper and left boundary walls.
Another testcase:
number of walls: 11
walls = (
[ ((22, 7),(19, 5))
, ((21, 6),(21, 4))
, ((24, 7),(24, 6))
, ((18, 8),(18, 8))
, ((17, 8),(17, 8))
, ((23, 8),(24, 9))
, ((17, 9),(17, 7))
, ((19, 8),(16, 8))
, ((16, 9),(14, 9))
, ((20, 9),(17, 7))
, ((18, 9),(17, 6))
])
width = 40
height = 16
expected = False
Your answer: True
There are 2 partitions in the center.
C translation
hint link is broken in description.
c#: Times out just reading in the results from a switch-case statement.
It has confirmed the results as "solved" once before, but instead of submitting I cleaned up some comments and functions that were no longer used.
Loading more items...