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.
From
Data.List
documentation:In my solution, the first parameter to
\\
is the alphabet set, thus punctuations and numbers are ignored, as they don't exist within the alphabet set.i and j should be as small as possible so for
209917
you take 2 at index 0 and put it at index 1; you get029917
which is29917
hence the expected output. For the second case your number5679775
is greater than the expected5657977
. If you agree could you mark the issue as resolved? By the way Ocaml fixed tests give the same results as the other languages.Fixed
Now we get a bug fix
Certain well-known algorithms can fail the Knight's Tour, depending on factors like size of the board (larger sizes, like a
200x200
board, for example). In this kata, the board sizes are 6,8,12, and 16 units in size so the majority of algorithms should work.I'm not sure if there is a case where no solution is possible; regardless, your suggestion has been added to the description.
By deleting the 'a' in the middle ! The description does not say that the deletion has to be performed at the end of the string. ;)
PS : please, if you have questions, post them as individual messages, not as replies of a previous discussion. ;)
This comment is hidden because it contains spoiler information about the solution
Thanks
^_^
Beautiful one-line solution! Thanks,
It seems OK!
You have translation waiting but one has had no notifications... Maybe when you translate you should post something like "Ocaml translation kumited" in the discussions part of the kata but not below your translation as here.
I haven't been notified of this post, it is only because I was curious to see if you had answered that I came here:-)
Approved!
PS: I find your solution a bit complicated but I am kind of a noob at Ocaml...:-)
Approved. Cheers and thanks for the translation!
I see just now your translation. Could you add some random tests?-)
It's a basic functional programming kata (8 kyu) - leave it as it is please.
No worries :) Haskell has got a long learning curve. The Control.Monad module is definitely worth checking out.
Change the type of the function to
solution :: Integer -> String
Loading more items...