• 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
markcodes Avatar
Name:Mark Anthony Codes
Clan:Unknown
Member Since:Apr 2021
Last Seen:Apr 2025
Profiles:
Following:1
Followers:0
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (16)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • akar-0
    • commented on "Which are in?" kata
    • 4 years ago

    Please use markdown tags to format your code or it is very discomfortable to read: how-to-format-code-in-markdown.

  • Custom User Avatar
    • Andy-Bartkiv
    • commented on "Don't Drink the Water" javascript solution
    • 4 years ago

    Hi, the indexOf() method searches the array for the specified item, and returns its position.

    To sort numbers in array descending good method is:
    [40, 100, 1, 5, 25, 10].sort((a,b) => b - a),
    as simple sort() method will sort values as strings, not as numbers.
    Good explanation here of the trick is here: https://www.w3schools.com/js/js_array_sort.asp

    In my case, I use DENS array (where letters are presorted manually) to provide an order in which I would like letters to be sorted.
    Insead of comapring values of b & a, I'm comparing indexes of b & a in my custom DENS array.
    Hope this helps.

  • Custom User Avatar
    • JohanWiltink
    • commented on "Don't Drink the Water" javascript solution
    • 4 years ago

    [...string] is just Array.from(string). That'll break up the string into an array of single characters, which is a bear to type in.

    There are actually quite some places where JS will handle a string as an array of characters.

  • Custom User Avatar
    • markcodes
    • commented on "Don't Drink the Water" javascript solution
    • 4 years ago

    idexOf is something new to me. Can you spare time to explain how your sort works?

  • Custom User Avatar
    • markcodes
    • commented on "Don't Drink the Water" javascript solution
    • 4 years ago

    can you please explain the returned arrays please?

  • Custom User Avatar
    • markcodes
    • commented on "Which are in?" kata
    • 4 years ago

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

  • Custom User Avatar
    • Kyle_Codes
    • commented on "Moving Zeros To The End" kata
    • 4 years ago

    Came here to see how many others said this. Maybe it's harder in other languages? I did it in Python and passed on my first attempt.

  • Custom User Avatar
    • Chrono79
    • commented on "Find the unique number" kata
    • 4 years ago

    Don't post solutions in Discourse, please.

  • Custom User Avatar
    • rajansahu713
    • commented on "Find the unique number" kata
    • 4 years ago

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

  • Custom User Avatar
    • Chrono79
    • commented on "Find the unique number" kata
    • 4 years ago

    No test is broken, they're fine. Please read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution

    JavaScript Completions 18109

  • Custom User Avatar
    • ulou
    • commented on "Find the unique number" kata
    • 4 years ago

    1 test in JavaScript is broken.
    "1 should equal 0"

  • Custom User Avatar
    • Chrono79
    • commented on "Find the unique number" kata
    • 4 years ago

    The unique number is the first item (like the test says). Print the input.

  • Custom User Avatar
    • mohanforpresident
    • commented on "Find the unique number" kata
    • 4 years ago

    Can someone explain what the test condition here is? My code seems to fail only in this
    The first item
    1 should equal 0

  • Custom User Avatar
    • rowcased
    • commented on "Find the unique number" kata
    • 4 years ago

    there are over 18 thousand solves in javascript (your language), so yeah. the kata is not broken.

  • Custom User Avatar
    • SunMaster
    • commented on "Find the unique number" kata
    • 4 years ago

    Hard to tell as you don't state which language you're using. But for something like Javascript the kata has already been completed by over 18k persons.

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...