Ad
  • Custom User Avatar

    I wish they would update the compiler, I got burnt on writing a Fortran Queue that makes use of allocatable data types. I wrote it in Visual Studio, but when I copied and pasted the code it the CodeWars compiler bounced back saying it did not support allocatabled data types.

    That is:

    TYPE QUEUE
    INTEGER:: I
    TYPE(QUEUE), ALLOCATABLE:: NXT
    END TYPE

    Resulted in the compiler complaining:

    TYPE(QUEUE), ALLOCATABLE:: NXT

    is not allowed when it is part of the Fortran 2008 Standard

  • Custom User Avatar

    But what happened to n being "relatively small"?

    Seriously. The description makes it seem like the algorithmic complexity isn't a factor. I would have approached this problem completely differently if I'd known the "relatively small" n would timeout. A bit frustrating to be honest, especially considering how many comments are pointing this out.

  • Custom User Avatar

    Thanks!

  • Custom User Avatar

    @Phil157 If you are stuck with the Fortran version of this Kata, feel free to post your code here and mark it as a spoiler so I can review it and perhaps provide some feedback, cheers :)

  • Custom User Avatar

    I think this output issue is due to the Fortran CW-2 testing framework itself. I'll look into improving its output by replacing special characters (such as newlines) with their escape sequence equivalents (e.g. \n) in my spare time.

  • Custom User Avatar

    I am asking @donaldsebleung to see your posts (he is the Fortran translator).

  • Custom User Avatar

    Outputs are different through languages.
    "(3(A, I0), A)" is good practice.

  • Custom User Avatar

    Bravo! You win too!

  • Custom User Avatar

    Rule 0 of any algorithm problems: Don't micro-optimize if your algorithm is at the wrong complexity ;-)

  • Custom User Avatar

    There are 200 random tests. My solution runs in about 700 ms so I think the number of tests is correct. Maybe the sort on the fly takes too much time. Think more about how you put the numbers in your array and avoid to sort.
    I'm afraid there are only the two of us to take this kata in Fortran...

  • Custom User Avatar

    I was running into a similar problem and talked to donaldsebleung about it (easy enough to comment on one of his Fortran solutions). His method, however, was to first create a static-length string, and then build from that. It seems Fortran has some ability to autosize strings, but only if it's built of existing strings and you concatenate. Writing directly into such strings I haven't fully sorted out yet. Often, I'm frustrated by Kata that are challenging mainly because of arbitrary string formatting output rather than programming or mathematical difficulty.

  • Custom User Avatar

    Agree. If for the first year the population declines then it will never get to p

  • Custom User Avatar

    Really weird! I completed my bug report https://github.com/Codewars/codewars.com/issues/1436. Thanks for your post.

  • Custom User Avatar

    I suppose that happens when you copy and paste my solution.
    The Fortran translation is well written but CW has replaced in the visible solution 1_ikind by _ikind hence the problem when you copy and paste my solution...
    I re-published the translation but the problem remains in the tests.
    I suppose it is only a problem "on the screen" since your solution passed the tests.
    I have signalled this bug: https://github.com/Codewars/codewars.com/issues/1436 number #1436.
    Thanks for your post.

  • Custom User Avatar

    By the way, please be patient when asking for help.

    Be patient. This mostly applies to forums, mailing lists, and code contributions (i.e. asynchronous forms of communication). It is possible that your question or code contribution or suggestion might not receive an immediate response. Be patient and consider the norms of the community. One reminder ping is welcome, many reminder pings in rapid succession are not a good display of patience. Similarly, posting the same question in multiple threads is frowned upon and should not be done.

    Codewars Community Code of Conduct

    If you're having a problem with a kata, ask questions and move on to another one. Don't expect immediate responses because they're just regular users like yourself. They're in different time zones, may not have time during weekdays, etc.

    If your issue is about Codewars itself, then open an issue on GitHub so that we can look into the problem.

  • Loading more items...