• 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
matthewmazurek Avatar
Name:Matt
Clan:Unknown
Member Since:Feb 2017
Last Seen:Aug 2023
Profiles:
    Following:0
    Followers:0
    Allies:0
    View Profile Badges
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (26)
    • Replies
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • RileyHunter
      • commented on "Exclamation marks series #13: Count the number of exclamation marks and question marks, return the product" javascript solution
      • 2 years ago

      ! is a regular character in JS regex, but ? is a special character (the "zero or one" quantifier in this specific instance) which has to be escaped.

    • Custom User Avatar
      • MarioGirardi
      • commented on "Exclamation marks series #13: Count the number of exclamation marks and question marks, return the product" javascript solution
      • 2 years ago

      /!/g how did it work without scaping like this /?/g

    • Custom User Avatar
      • ejini战神
      • resolved an issue on "#7 Matrices: Focused on the Contour" kata
      • 3 years ago
    • Custom User Avatar
      • raulbc777
      • commented on "#7 Matrices: Focused on the Contour" kata
      • 8 years ago

      your solution upvoted (clever + 1)

    • Custom User Avatar
      • raulbc777
      • resolved a suggestion on "#7 Matrices: Focused on the Contour" kata
      • 8 years ago

      Thanks a lot! Fixed!

    • Custom User Avatar
      • Voile
      • created a suggestion for "#7 Matrices: Focused on the Contour" kata
      • 8 years ago

      Probably a (O²) algorithm will not pass the tests

      Complexity notation doesn't work like that, it should be O(n²).

    • Custom User Avatar
      • raulbc777
      • commented on "#7 Matrices: Focused on the Contour" kata
      • 8 years ago

      Thanks for your solution, upvoted (clever +1)

    • Custom User Avatar
      • raulbc777
      • commented on "#7 Matrices: Focused on the Contour" kata
      • 8 years ago

      countourMode = countTourMode, it should be :)

    • Custom User Avatar
      • matthewmazurek
      • created an issue for "#7 Matrices: Focused on the Contour" kata
      • 8 years ago

      The function name is misspelled in JS (should be contourMode).

    • Custom User Avatar
      • dinglemouse
      • commented on "What's Your Poison?" kata
      • 9 years ago

      Just think about 1000 bottles of whine.

      LOL. I suppose the King can store them in the palace cellar along with his 50 barrels of grizzle, 20 tubs of whinge, and that giant vat of moan that nobody wants to go near...

      :-)

    • Custom User Avatar
      • SimonR
      • commented on "What's Your Poison?" kata
      • 9 years ago

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

    • Custom User Avatar
      • Tandyman
      • commented on "What's Your Poison?" kata
      • 9 years ago

      You are right.
      it was only in the python translation - now it's fixed.
      thanks.

    • Custom User Avatar
      • matthewmazurek
      • commented on "What's Your Poison?" kata
      • 9 years ago

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

    • Custom User Avatar
      • kazk
      • commented on "Consecutive strings" kata
      • 9 years ago

      The ECMAScript standard doesn't specify and V8 (NodeJS, Chromium) doesn't guarantee stability, so this is expected.

      However, the longer random examples in this Kata appeared to break this pattern, and equivalent length strings were rearranged in the array after the sort method. I'm not able to explain this behaviour.

      I haven't looked at the source, so I'm just guessing, but probably the sorting algorithm used depends on the length of the array. Switching to unstable but faster one for larger array.

      ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].sort((a, b) => a.length - b.length);
      ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
      
      ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a'].sort((a, b) => a.length - b.length);
      ['5', '0', '2', '3', '4', '1', '6', '7', '8', '9', 'a']
      

      Looks like in-place quicksort and insertion sort is used (v8/src/js/array.js#L709-L1002).

      // Insertion sort is faster for short arrays.
      if (to - from <= 10) {
        InsertionSort(a, from, to);
        return;
      }
      
    • Custom User Avatar
      • matthewmazurek
      • commented on "Consecutive strings" kata
      • 9 years ago

      Interesting Kata. I've discovered a quirk about the javacript Array.prototype.sort method, that sometimes re-arranges array items in an unexpected fashion. For example, when implementing the following code, the expected result is returned.

      ['abc', 'def', 'ghi'].sort((a, b) => a.length - b.length).join('') // => 'abcdefghi'
      

      However, the longer random examples in this Kata appeared to break this pattern, and equivalent length strings were rearranged in the array after the sort method. I'm not able to explain this behaviour.

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

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...