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.
Here you can talk about functional programming, which finds its roots in lambda calculus.
But here stops the comparison, because there isn't something close to a computational model here.
Lambda calculus and Turing machine are equivalent computational models because they can solve the same class of problems.
I have the feeling that the comparison you want to bring here is more about functional programming vs. imperative programming.
I feel like it is something trying to be close to what is called the "lambda calculus" which is different from the "turing machine" model of computation. Some people never took classes to learn these but these are the best terms I know. both are equivalent because both are turing complete.
Find repeating patterns in the algorithm, normalize it into some code statements. You do not need to go through all
N
squares and check whether each of them have been visited upon every iteration.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
From 2, try to solve all possible triangles with bigger and bigger length, by hand. Until one point you will find it. GLHF.
Since A & A = 1 and logical OR is True when at least one operand is True, the response is "1 OR 0 OR 0" = 1.
(Logical AND has a higher priority than OR)
Damn, I didn't think it was possible to do it in one line.
Nice job!
Take a look at the last 2 columns, the 3s and 5s.
This comment is hidden because it contains spoiler information about the solution
Not an issue. This kata is BF-specific.
Its first arg (enclosed in
()
) is actually a generator expression. You may find enlightening this reading about iterators :)This comment is hidden because it contains spoiler information about the solution
By 'take two of different color each day' it means you can't pick the same color twice, but you CAN pick for example from 1 & 3 on day1, and 1 & 3 on day2.
This is why for
solve([8,1,4])
you can pick 1 & 2, then 1 & 3 (4 times), and only the first color will be remaining. Forsolve([8,2,8])
, it's 1 & 2, 2 & 3 and then 7x 1 & 3.Does that make it clearer?
This comment is hidden because it contains spoiler information about the solution