• 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
  • 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
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
Timm3D Avatar
Name:Tim
Clan:ORCA
Skills:c#, java
Member Since:Sep 2019
Last Seen:Nov 2024
Profiles:
Following:26
Followers:26
Allies:24
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (143)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • Carlos-Simim
    • commented on "Jimmy's Car Leasing" kata
    • 3 years ago

    That's part of the solution, why would the description show it?

  • Custom User Avatar
    • Wei-Ting Yang
    • resolved an issue on "Weird IPv6 hex string parsing" kata
    • 3 years ago

    .

  • Custom User Avatar
    • Coderator
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    Then how can I show that it is an integer division?

  • Custom User Avatar
    • Coderator
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    lol

  • Custom User Avatar
    • FArekkusu
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    // is an inline comment in C#...

  • Custom User Avatar
    • Coderator
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    Changed the first one to
    15000km (allowedKmsPerYear) // ( 365 days or 366 days if its a leap year ) = 41km

  • Custom User Avatar
    • FArekkusu
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    This change does not address the original issue in any way.

  • Custom User Avatar
    • Coderator
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    Changed to
    (3316km (currentKms) / 2173km (allowedKmsToTargetDate)) * 100 = 152.60% (return value)

  • Custom User Avatar
    • Coderator
    • resolved an issue on "Jimmy's Car Leasing" kata
    • 4 years ago

    Okay, it is fixed too!
    I just saw that the allowedKmsPerDay is an integer in C#.
    And that's what makes the difference.
    Now the sample tests and final tests are the same in both languages.
    The only difference is, first final test returns 100 in C# but it is 100.01 in Python.
    I don't know if it's a problem.
    Thanks again!

  • Custom User Avatar
    • Coderator
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    Thanks Sir, I changed the solution.
    Now it accounts the leap year, but I have a question about the answers.
    In C#,
    Codewars.LimitExceeded(new DateTime(2017, 4, 23),new DateTime(2017, 10, 23), 15000, 10777) returns 143.64
    But in Python,
    limit_exceeded(date(2017, 4, 23), date(2017, 10, 23), 15000, 10777) returns 143.30
    Every test is like this, there are small differences between the answers and i don't know why. Do you have any ideas on this?

  • Custom User Avatar
    • dfhwze
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    But I don't think the reference solution in Python does so.
    Also check the C# reference solution, and try to find how division is done there, so you can adapt the Python reference solution accordingly.

  • Custom User Avatar
    • Coderator
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    Oops. I'll try to fix it, sorry.

  • Custom User Avatar
    • dfhwze
    • commented on "Jimmy's Car Leasing" kata
    • 4 years ago

    More specifically, Python does not take into account the leap year and there are some discrepancies concerning integer and float division.

  • Custom User Avatar
    • Coderator
    • resolved an issue on "Jimmy's Car Leasing" kata
    • 4 years ago

    Fixed.

  • Custom User Avatar
    • Coderator
    • resolved an issue on "Jimmy's Car Leasing" kata
    • 4 years ago

    Fixed.

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...