• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Career
  • Opportunities
    Find your next career challenge – powered by Qualified Jobs
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Log In
  • Sign Up
wildhamster26 Avatar
Name:Sagy Mizrahi
Clan:Ironhack
Member Since:Oct 2018
Last Seen:Jun 2021
Profiles:
Following:796
Followers:795
Allies:786
View Profile Badges
Ad
Promoted
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (120)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • Maxhu787
    • commented on "Closest elevator" kata

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

  • Custom User Avatar
    • darksbond
    • commented on "Bingo ( Or Not )" javascript solution

    too much worked

  • Custom User Avatar
    • laurelis24
    • commented on "Closest elevator" kata

    I remember struggling on this a bit. xD

  • Default User Avatar
    • Yemmi
    • commented on "Closest elevator" kata

    You need to import kotlin.math.*

  • Custom User Avatar
    • Elfein7Night
    • resolved a question on "Closest elevator" kata
  • Default User Avatar
    • farhanaditya
    • commented on "Closest elevator" kata

    Forget about formula, focus on logic and solving steps. First, try to solve it in a paper. How would you determine which elevator will reach your floor first? After you figure that out, convert it to codes.

  • Default User Avatar
    • BriscoRP
    • created a question for "Closest elevator" kata

    I assume it is maths logic? please advise me re: what is the formula and I will try and write the code, I am struggling to find the pattern! thanks :)

  • Custom User Avatar
    • pauk77uk
    • commented on "Closest elevator" kata

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

  • Custom User Avatar
    • user8436785
    • resolved a suggestion on "Closest elevator" kata
  • Custom User Avatar
    • FArekkusu
    • resolved a suggestion on "Closest elevator" kata
  • Custom User Avatar
    • mitron6
    • created a suggestion for "Closest elevator" kata

    Racket translation

  • Custom User Avatar
    • Chrono79
    • commented on "Closest elevator" kata

    The tests are ok, it's your code what's wrong. And what I told you is this:

    Log
    Testing for: left = 1, right = 2, call = 0
    'right' should equal 'left'
    

    that's a single test, first the log, then the test result.

    About your code, your second elif condition is the same as the if condition and overall it's not ok, that's why it's failing. You can test your code with that input in the sample tests.

  • Default User Avatar
    • BojackHorseman
    • commented on "Closest elevator" kata

    Looking at the above returned log, the left elivator is on the first floor, and the right elevator is on the ground level.
    The call is made on the ground level meaning that the right elevator is the closest (already on the same level). So 'left'is not the correct outcome or the exercise description is wrong.
    It seems to test for the previous input for call, in that case it would be nice to add this to the description to the exercise to avoid confusion.

  • Custom User Avatar
    • Chrono79
    • commented on "Closest elevator" kata

    The log appears before the test result, and that input expects "right". Check your code.

  • Default User Avatar
    • BojackHorseman
    • commented on "Closest elevator" kata

    Test set is wrong because of the following output:'right' should equal 'left'
    Testing for: left = 1, right = 0, call = 0
    In this case "right" should be the correct answer as it is on the same floor as the call int, however it still tells me the output should be left.

  • Loading more items...
  • © 2022 Codewars
  • About
  • API
  • Announcements
  • Privacy
  • Terms
  • Contact
  • powered by

Confirm

  • Cancel
  • Confirm

Collect: kata

Loading collection data...

Add To My Collections
    • View
      Remove Add
    You have not created any collections yet.

    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.

    You must wait until you have earned at least 20 honor before you can create new collections.

Set the name for your new collection. Remember, this is going to be visible by everyone so think of something that others will understand.

Create & Add New Collection