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.
If you switched the order of checking if x and y are within range and switched the check on x to maze[y].Length, this code would also work for mazes with uneven shapes.
I do not get this solution man, can you explain?
Who gives this piece of a bad code "best practices"? He could also name every variable a/b/c/d/e/f....
The two-dimensional
int
array could bebool
s instead, making this slightly more readable and lessening the impact of converting from a string (a one-dimensional char array).This is clean and simple.
& in this code is a bitwise operator that looks up the lowest bit of a and compare with 1?
Great solution
Wow this is an elegant solution. Good work.
I think NextValue would be better named: "LastValue" to better convey its description as the last value in the range.
tailrec
can be prepended tofun
I think using a seperate (nested) class for your list item would improve readability dramatically.
can i get bonus points for letting the integer division do all the work instead of bringing in if/else or a modulus
I agree with @dlcoe, This is an excellent answer and beautifully simple! I went with a sans-regex approach for my solution. Wanted to try out a recursive method since I don't use recursion often.