• 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
CookiesAndStuff Avatar
Name:Unknown
Clan:Unknown
Member Since:Dec 2023
Last Seen:Dec 2024
Profiles:
    Following:0
    Followers:0
    Allies:0
    View Profile Badges
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (17)
    • Replies
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • ohno0805
      • created an issue for "Middle of Rearranged Digits" kata
      • 17 months ago

      The hidden tests do not always test for numbers like "7000" or "400". Code, that does not handle those numbers, can pass the hidden tests if the user is lucky. I suggest to hardcode a number like "7000" or "400" into the hidden test.

    • Custom User Avatar
      • trashy_incel
      • commented on "Middle of Rearranged Digits" kata
      • 17 months ago

      unsigned long long would be even better since the input is never negative. it also avoids the problem that long is 32-bit in Windows world and 64-bit in Linux world, making code less portable for no reason (long long is 64-bit in both)

    • Custom User Avatar
      • trashy_incel
      • created a suggestion for "Middle of Rearranged Digits" kata
      • 17 months ago
      • In modern C, the return type should be a bool (from <stdbool.h>)
      • the input type should be marked as unsigned
      • you need to put the fixed tests in the full tests suite as well
      • suggested edge cases that should be in the fixed tests: 0, 10, 1000, 1001, 2001
      • the functions defined in the tests must all be static, otherwise the user might call them
      • you should extract your reference solution to a function to make the random tests more maintainable
    • Custom User Avatar
      • CookiesAndStuff
      • commented on "Middle of Rearranged Digits" kata
      • 17 months ago

      Okay I think I've fixed it, could you check if it works for you now?

    • Custom User Avatar
      • Fbasham
      • created an issue for "Middle of Rearranged Digits" kata
      • 17 months ago

      Are you sure your solution is still correct after making changes below?

      For random input: 735027429

      smallest: 202345779

      largest: 977543220

      actual result: 0

      expected result: 1

    • Custom User Avatar
      • CookiesAndStuff
      • commented on "Middle of Rearranged Digits" kata
      • 17 months ago

      oh okay, I'll try to fix it

    • Custom User Avatar
      • mauro-1
      • commented on "Middle of Rearranged Digits" kata
      • 17 months ago

      No, don't use floating point numbers (float, single, double, half, quad, extended, ...) to solve integer problems.

    • Custom User Avatar
      • CookiesAndStuff
      • resolved a question on "Middle of Rearranged Digits" kata
      • 17 months ago

      No, I changed it to long

    • Custom User Avatar
      • CookiesAndStuff
      • resolved an issue on "Middle of Rearranged Digits" kata
      • 17 months ago

      Okay ty, I changed it to double

    • Custom User Avatar
      • mauro-1
      • created an issue for "Middle of Rearranged Digits" kata
      • 17 months ago

      Reference solution fails when num > $2^{23}$.

      Never use floats unless strictly necessary.

    • Custom User Avatar
      • Voile
      • created a question for "Middle of Rearranged Digits" kata
      • 17 months ago

      Is there any reason why the input is int and not long? long would be more appropriate for this kata.

    • Custom User Avatar
      • CookiesAndStuff
      • resolved a suggestion on "Middle of Rearranged Digits" kata
      • 17 months ago

      Thanks for the suggestions, I've added that now

    • Custom User Avatar
      • uttumuttu
      • created a suggestion for "Middle of Rearranged Digits" kata
      • 17 months ago

      I see a viable kata here, but the tests should be tougher. Currently there are only three difficult inputs, all hard-coded. I suggest:

      1. Creating random difficult inputs (i.e., those with lots of zeros), e.g., 100 such inputs.
      2. Increasing the number of random tests in general, e.g., to 500 random inputs.
    • Custom User Avatar
      • CookiesAndStuff
      • resolved an issue on "Middle of Rearranged Digits" kata
      • 17 months ago

      No, that does become a decimal number; since 1034456789 (the lowest, can't start with 0) + 9876544310 = 10911001099 which ends in 9 so is a decimal point when devided by 2. I also added that numbers can't start with 0 to the description since it was unclear before
      Edit: wait nevermind I was just wrong it's fixed now though cuz it has random numbers

    • Custom User Avatar
      • CookiesAndStuff
      • resolved an issue on "Middle of Rearranged Digits" kata
      • 17 months ago

      Ty I fixed it

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

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...