• Custom User Avatar
  • Custom User Avatar

    From Data.List documentation:

    In the result of xs \\ ys, the first occurrence of each element of ys in turn (if any) has been removed from xs.

    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.

  • Custom User Avatar

    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 get 029917 which is 29917 hence the expected output. For the second case your number 5679775 is greater than the expected 5657977. If you agree could you mark the issue as resolved? By the way Ocaml fixed tests give the same results as the other languages.

  • Custom User Avatar

    Fixed

  • Custom User Avatar

    Now we get a bug fix

  • Custom User Avatar

    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.

  • Custom User Avatar

    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. ;)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    Beautiful one-line solution! Thanks,

  • Custom User Avatar

    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!

  • Custom User Avatar

    I see just now your translation. Could you add some random tests?-)

  • Custom User Avatar

    It's a basic functional programming kata (8 kyu) - leave it as it is please.

  • Custom User Avatar

    No worries :) Haskell has got a long learning curve. The Control.Monad module is definitely worth checking out.

  • Custom User Avatar

    Change the type of the function to
    solution :: Integer -> String

  • Loading more items...