7 kyu

Monotone travel

582 of 6,748bkaes
Description
Loading description...
Lists
Fundamentals
  • Please sign in or sign up to leave a comment.
  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • saudiGuy Avatar

    This comment has been hidden.

  • DallogFheir Avatar

    Description is confusing, decreasing (or non-increasing) sequences are also monotonic...

  • akar-0 Avatar

    COBOL translation (author inactive).

  • akar-0 Avatar

    This comment has been hidden.

  • dinglemouse Avatar

    Wrong example in Kata description causes unnecessary confusion.

    is_monotone(3, {3, 2, 2}) == true
    

    I don't think so.

    Looks to be a problem with C translation only?

  • dfhwze Avatar

    Not the best description. Some users think the items should never drop below the first item, others (like me) read it as there should be at least 1 element for which all successors are either the same or bigger. Make it clear that by any you mean that the condition should be true for all.

  • Kyle_Codes Avatar

    I managed to come up with something in Python that works and it was accepted, but when I tried it again (the exact same code), it said "should work on random lists: True should equal False". Not sure why that is

  • rowcased Avatar

    C translation kumited

    please scrutinize for approval

    domo!

  • Voile Avatar

    Note that the first test is is_monotone(range(1, 11)), which will fail for Python 3 (because range returns a range object and not a list).

    According to the descriptions the input should be a list, so this is not correct.

  • eb110 Avatar

    "Your job is to check whether for any x all successors are greater or equal to x" - so how come int a = {3, 2, 2} is a false?? Any which means a1 == a2 - so it should to be true.

  • luxxar Avatar

    This comment has been hidden.

  • Javatlacati Avatar

    CoffeeScript translation kumited! Please Accept :D

  • caspinall Avatar

    Just a heads up on this one. Do not modify the heights input parameter.

    The random test case was failing for me because I modified heights. I made a copy of heights instead and the test case passed.

    (I did the python version)

  • vishal-yadav Avatar

    This comment has been hidden.

  • vishal-yadav Avatar

    Don't know why my code won't work. Getting 'unknown error' while submitting though all possible test cases including kata tests are passing.

  • Jasmine  Avatar

    This comment has been hidden.

  • basilbeltran Avatar

    This comment has been hidden.

  • cmplank Avatar

    The description, example, and tests don't make it clear that each consecutive number must be equal to or greater than each previous. I had taken it to mean that they must not dip below the starting altitude. Clarification on that point would be helpful. Maybe just another example like isMonotone([3,4,3]) == false

  • Aria_vt Avatar

    This comment has been hidden.

  • rmeis Avatar

    Can't submit working solution, due to this error: "test.hs out of memory, requested x bytes"

  • sharpattack Avatar

    This comment has been hidden.

  • najt Avatar

    I am unable test my program, submit button does not work :-(

  • zeroone001 Avatar

    It's interesting.How to put the own code in here.

  • tomtatchell Avatar

    This comment has been hidden.

  • lllblll Avatar

    hey,

    my code passes all the initial tests, but when i want to submit my solution, it fails about 20%-25% of the final test. I have no clue why. can anyone give me some pointers?

  • nielsup Avatar

    This comment has been hidden.

  • mandeepb Avatar

    I fail the constant list test in CodeWars, however my code works in my text editor. Can someone point me in the right direction? The CodeWars output doesn't tell me anything.

  • RM84 Avatar

    This comment has been hidden.

  • RichardB Avatar

    This comment has been hidden.

  • GiacomoSorbi Avatar

    I translated it into ruby: I admit it was a bit tricky with the random arrays (I had little experience dealing with it), but it all should be fine now, in case you want to add it to this simple, yet entertaining and stimulating kata :)

  • cyvvilek Avatar

    This comment has been hidden.

  • licaroli Avatar

    What does the "||" in "heights = [Integers] || [Floats]" mean?

  • jacobb Avatar

    My solution clearly shouldn't pass.

    I.e. you need to make a copy of the original array to compare against otherwise it can be mutated in the solution.

    My first solution, which should have worked, didn't pass because I mutated the array.

  • ajcogan Avatar

    This comment has been hidden.

  • user3482173 Avatar

    Monotone is a common term to designate either increasing or decreasing sequence/function. So your kata and test cases are very ambiguous.
    In mathematics [3,2,1] is monotonic for example [3,2,2] too.

  • natw Avatar

    This comment has been hidden.

  • knotman90 Avatar

    Some typos in test cases