• 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
  • Career
  • Opportunities
    Find your next career challenge – powered by Qualified Jobs
  • 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
  • Log In
  • Sign Up
c0nspiracy Avatar
Name:Robert Newbould
Clan:FreeAgent
Member Since:Dec 2014
Last Seen:May 2022
Profiles:
Following:7
Followers:67
Allies:7
View Profile Badges
Ad
Promoted
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (211)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • juliangalardi
    • commented on "Who likes it?" ruby solution

    You should avoid at all cost switch/case statements, its a case smell.

  • Custom User Avatar
    • zzJZzz
    • commented on "Beginner Series #1 School Paperwork" ruby solution

    This solution and others like it has helped me a lot with refactoring

  • Custom User Avatar
    • c0nspiracy
    • commented on "Dashatize it" ruby solution

    Thanks for the tip. I think the Kata description has changed since I wrote my solution.

  • Custom User Avatar
    • Husoski
    • commented on "Dashatize it" ruby solution

    Nice regex, but the type checking is wrong. The statement says "If n is not an integer, return an empty value."
    Try using #instance_of? or #is_a? instead of a "truthy" test.

  • Custom User Avatar
    • cameronbibb
    • commented on "Consecutive strings" ruby solution

    That is an extra fail-safe. In the chance that strarr.each_cons(k).map(&:join).max_by(&:length) returns nil, which it will if the array strarr is empty, then an empty string will be returned. Since nil is falsey, '' (the empty string) will be returned when the || expression is evaluated on the last line—since strings are considered truthy. The first line of the method should handle cases where strarr points to an empty string, but it's not bad to have a back up.

  • Custom User Avatar
    • dedemenezes
    • commented on "Persistent Bugger." ruby solution

    Thank you for this comment rsrs. I started to study this year and I was looking and wondering why people were converting to strings and than back to integer

  • Custom User Avatar
    • TheGoldKay
    • commented on "Find the first non-consecutive number" ruby solution

    what if the sequence 'step' isn't one? what if it's increasing by 2 for example?

  • Custom User Avatar
    • akar-0
    • commented on "Reverse words" ruby solution

    Matches any substrings of consecutive non space characters. See here for example.

  • Custom User Avatar
    • Sebas1012
    • commented on "Reverse words" ruby solution

    Could you explain to me what the "\ S +" does?

  • Custom User Avatar
    • omegahm
    • commented on "Lost number in number sequence" ruby solution

    If the resulting array is empty, calling first will yield nil, which needs to be converted into 0. This can be done either by using to_i or || 0.

  • Default User Avatar
    • Funki
    • commented on "Lost number in number sequence" ruby solution

    Why would .to_i be necessary? The array consists of integers only.

  • Custom User Avatar
    • parkdev
    • commented on "Sort the odd" ruby solution

    Well done.

  • Custom User Avatar
    • ethanling2002
    • commented on "Consecutive strings" ruby solution

    what is the purpose of || "" at the end?

  • Custom User Avatar
    • stkkk
    • commented on "Persistent Bugger." ruby solution

    Each time its 5 times less code than mine :D

  • Custom User Avatar
    • bkmaibach
    • commented on "Grasshopper - Summation" ruby solution

    Okay Gauss

  • Loading more items...
  • © 2022 Codewars
  • About
  • API
  • Announcements
  • Privacy
  • Terms
  • Contact
  • powered by

Confirm

  • Cancel
  • Confirm

Collect: kata

Loading collection data...

Add To My Collections
    • View
      Remove Add
    You have not created any collections yet.

    Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.

    Get started now by creating a new collection.

    You must wait until you have earned at least 20 honor before you can create new collections.

Set the name for your new collection. Remember, this is going to be visible by everyone so think of something that others will understand.

Create & Add New Collection