It seems so. Note that tr is outside the (\m -> ...) part, therefore hopefully all calls to the lambda would reuse the same instance of tr instead of creating a new one each time. It the entire purpose of the function memo.

Okay, you want to do it in sections. Why is this the optimal way? It sure does sound like you can do better than a linear search through the sections right?

Honestly, I set up the graph like this so I can use a scipy function, but then noticed that the version on CW is pretty old and didn't have the function. So I just implemented one myself it in essentially the most 'direct translation of algorithm idea' way possible.

Efficient? Probably not the most efficient, but I think it's likely good enough.

To go from A to A without moving, you just move zero steps. To go from A to A through a looping edge, you move one step by going through the looping edge.

An empty array is an array, simlarly an empty sequence of edges is an empty path. One that doesn't contain any - in the string representation i.e. no edges.

It seems so. Note that

`tr`

is outside the`(\m -> ...)`

part, therefore hopefully all calls to the lambda would reuse the same instance of`tr`

instead of creating a new one each time. It the entire purpose of the function`memo`

.Does

`memo fn = (\m -> ...`

behave differently to`memo fn m = ...`

?Fixed for both

the initial solution is passing the sample tests. Meaning they are useless to the user... ;o

and is that normal that I get only white rectangles for every input/output??

.

Thanks for spotting, fixed.

In the description there is (at least) a verb missing:

it's not fair

Not so much. There are worst katas ;)

Well that I can't really help too much because it's your job after all

You did sound like you were serious doubting the correctness of the given tests. I hope I at least partially addressed that.

Unaware doesn't mean it doesn't exist, so it does not constitute a reason.

Can you come up with a way to calculate exactly what strategy to use exactly instead of just coming up with random ones and see if they work?

Okay, you want to do it in sections. Why is this the optimal way? It sure does sound like you can do better than a linear search through the sections right?

Honestly, I set up the graph like this so I can use a scipy function, but then noticed that the version on CW is pretty old and didn't have the function. So I just implemented one myself it in essentially the most 'direct translation of algorithm idea' way possible.

Efficient? Probably not the most efficient, but I think it's likely good enough.

To go from A to A without moving, you just move zero steps. To go from A to A through a looping edge, you move one step by going through the looping edge.

An empty array is an array, simlarly an empty sequence of edges is an empty path. One that doesn't contain any

`-`

in the string representation i.e. no edges.Also, there's no probabality to be found in this problem. There's no randomness and every case

hasto work, exactly.## Loading more items...