• 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
Psychemaster Avatar
Name:Martin Hayward
Clan:Unknown
Skills:javascript
Member Since:May 2014
Last Seen:Nov 2021
Profiles:
Following:0
Followers:0
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (59)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • n64expansionpak
    • commented on "Largest pair sum in array" javascript solution
    • 3 months ago

    wow i totally forgot about sorting in descending order

  • Custom User Avatar
    • bhamscott
    • commented on "Largest pair sum in array" javascript solution
    • 2 years ago

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

  • Custom User Avatar
    • Mabdulwahab
    • commented on "Largest pair sum in array" javascript solution
    • 3 years ago

    This is a clever solution!

  • Custom User Avatar
    • sol3uk
    • commented on "Consecutive strings" kata
    • 5 years ago

    This is 100% correct, parts of the description are not highlighted enough, like a nuance of this would be it needs to be the FIRST result, although it is stated, it melds into the rest of the description and does not stand out.

  • Custom User Avatar
    • yuudachi
    • commented on "Consecutive strings" kata
    • 5 years ago

    I understood this description immediately!! Also the original should have more examples (i.e. longest string in array not necessarily being in the answer)

  • Custom User Avatar
    • SirSkylord
    • commented on "Consecutive strings" kata
    • 5 years ago

    This is great, thank you, Psychemaster!

  • Custom User Avatar
    • JohanWiltink
    • commented on "Largest pair sum in array" javascript solution
    • 5 years ago

    This changes the array as well.

  • Custom User Avatar
    • JohanWiltink
    • commented on "Largest pair sum in array" javascript solution
    • 5 years ago

    Depends on the size of the array.

  • Custom User Avatar
    • costagavras
    • commented on "Consecutive strings" kata
    • 5 years ago

    Thank you. Went to the comments section just to check if it's the description or my poor English.

  • Custom User Avatar
    • HUe1998
    • commented on "Consecutive strings" kata
    • 5 years ago

    This should have been the actual description.

  • Custom User Avatar
    • Psychemaster
    • commented on "Simple Fun #247: To And From" kata
    • 5 years ago

    Gotta say, I like how the test cases in this one heavily discouraged an iterative solution - pretty neat!

  • Custom User Avatar
    • Psychemaster
    • created a suggestion for "Consecutive strings" kata
    • 5 years ago

    Slightly Clearer Description

    Task

    You are given an array of string inputs strarr and an integer k.

    Your task is to return the longest possible string that can be derived by combining k consecutive elements of the input strarr.

    Example

    longest_consec(["red", "orange", "yellow", "green", "blue", "indigo", "violet"], 2) should return "orangeyellow"

    Notes

    In the case of there being multiple possible matches, only the first one will be considered correct.

    In any of the following cases, the return value should be an empty string "":

    • strarr.length === 0
    • strarr.length < k
    • k <= 0
  • Custom User Avatar
    • TGeo
    • commented on "Largest pair sum in array" javascript solution
    • 8 years ago

    Also, even if you had to go through the array twice that's 2n wheras nlogn still takes longer for large n. And in any case 2n is O(n).

  • Custom User Avatar
    • swaggermaster
    • commented on "Largest pair sum in array" javascript solution
    • 9 years ago

    I liked it, looks cool for small arrays

  • Custom User Avatar
    • omgirok
    • commented on "Largest pair sum in array" javascript solution
    • 10 years ago

    uhhhhhhhhh no you can keep track of the 2 greatest numbers visited so far in the array as you loop through lol

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...