Begin a new Kumite
Search
About
  • Filter by Language:
  • Kumite (ko͞omiˌtā) is the practice of taking techniques learned from Kata and applying them through the act of freestyle sparring.

    You can create a new kumite by providing some initial code and optionally some test cases. From there other warriors can spar with you, by enhancing, refactoring and translating your code. There is no limit to how many warriors you can spar with.

    A great use for kumite is to begin an idea for a kata as one. You can collaborate with other code warriors until you have it right, then you can convert it to a kata.

Code
Diff
  • function removeEveryThird(str) 
    {
        var returnString = ''; 
        var words = str.split(' '); 
        var counter = 0; 
        
        for (var i = 0; i < words.length; i++) 
        { 
            var word = words[i]; 
            counter = 0; 
            for (var j = 0; j < word.length; j++) 
            { 
                if (counter !== 3) 
                { 
                    returnString += word.charAt(j); 
                }
                counter++;
            }
        }
        
        return returnString;
    }
  • 1
    function removeEveryThird(str) {
    
    2
      // Remove the third character from every work in the string
    
    3
      // using a zero based index
    
    4
      return 'heloword';
    
    1+
    function removeEveryThird(str) 
    
    2+
    {
    
    3+
        var returnString = ''; 
    
    4+
        var words = str.split(' '); 
    
    5+
        var counter = 0; 
    
    6+
        
    
    7+
        for (var i = 0; i < words.length; i++) 
    
    8+
        { 
    
    9+
            var word = words[i]; 
    
    10+
            counter = 0; 
    
    11+
            for (var j = 0; j < word.length; j++) 
    
    12+
            { 
    
    13+
                if (counter !== 3) 
    
    14+
                { 
    
    15+
                    returnString += word.charAt(j); 
    
    16+
                }
    
    17+
                counter++;
    
    18+
            }
    
    19+
        }
    
    20+
        
    
    21+
        return returnString;
    
    55
    }
    
Code
Diff
  • public class FizzBuzz
    {
        public string GetOutput(int number) {
          if (number % 3 == 0 && number % 5 == 0) {
            return "FizzBuzz";
          }
          else if (number % 3 == 0) {
            return "Fizz";
          }
          else if (number % 5 == 0) {
            return "Buzz";
          }
          else {
            return number.ToString();
          }
          // Fizz buzz is a popular computer science interview question.  
          // The function above is given a number - if the number is
          // divisible by 3, return "fizz", if it's divisible by 5, 
          // return "buzz", if not divisble by 3 or 5 - return the
          // number itself.
        }
    }
  • 11
    public class FizzBuzz
    
    22
    {
    
    33
        public string GetOutput(int number) {
    
    4+
          if (number % 3 == 0 && number % 5 == 0) {
    
    5+
            return "FizzBuzz";
    
    6+
          }
    
    7+
          else if (number % 3 == 0) {
    
    8+
            return "Fizz";
    
    9+
          }
    
    10+
          else if (number % 5 == 0) {
    
    11+
            return "Buzz";
    
    12+
          }
    
    13+
          else {
    
    14+
            return number.ToString();
    
    15+
          }
    
    44
          // Fizz buzz is a popular computer science interview question.  
    
    55
          // The function above is given a number - if the number is
    
    66
          // divisible by 3, return "fizz", if it's divisible by 5, 
    
    77
          // return "buzz", if not divisble by 3 or 5 - return the
    
    88
          // number itself.
    
    9
          return "0";
    
    1010
        }
    
    1111
    }
    
Code
Diff
  • const find_unique_items = (array1, array2) =>
      array2.includes(8) ? [1,2,4,6,8]: [1,3,4,6,7,8]
  • 1
    const find_unique_item = (array1, array2)=>
    
    2
      array2.includes (8) ? [1,2,3,4,6,8]: [1,3,4,6,7,8]
    
    1+
    const find_unique_items = (array1, array2) =>
    
    2+
      array2.includes(8) ? [1,2,4,6,8]: [1,3,4,6,7,8]
    

Recent Moves:

Code
Diff
  • public class Kata {
        public static int findMax(int[] my_array) {
            // Write a method that returns the largest integer in the list.
            // You can assume that the list has at least one element.
            return findMax;
        }
    }
  • 11
    public class Kata {
    
    22
        public static int findMax(int[] my_array) {
    
    33
            // Write a method that returns the largest integer in the list.
    
    44
            // You can assume that the list has at least one element.
    
    5
            return 7;
    
    5+
            return findMax;
    
    66
        }
    
    77
    }
    
Fundamentals
Strings
Code
Diff
  • public class FizzBuzz
    {
        public string GetOutput(int number) =>
            (number % 3, number % 5) switch
            {
                (0, 0) => "FizzBuzz",
                (0, _) => "Fizz",
                (_, 0) => "Buzz",
                (_, _) => $"{number}"
            };
    }
  • 11
    public class FizzBuzz
    
    2
     {
    
    3
       public string GetOutput(int number)
    
    4
       {
    
    5
         var ret = string.Empty;
    
    6
         
    
    7
         if (number % 3 == 0)
    
    8
           ret += "Fizz";
    
    9
         if (number % 5 == 0)
    
    10
           ret += "Buzz";
    
    11
         
    
    12
         if (ret.Length == 0)
    
    13
           ret = number.ToString();
    
    14
         return ret;
    
    15
       }
    
    2+
    {
    
    3+
        public string GetOutput(int number) =>
    
    4+
            (number % 3, number % 5) switch
    
    5+
            {
    
    6+
                (0, 0) => "FizzBuzz",
    
    7+
                (0, _) => "Fizz",
    
    8+
                (_, 0) => "Buzz",
    
    9+
                (_, _) => $"{number}"
    
    10+
            };
    
    1616
    }
    

Recent Moves:

Code
Diff
  • public class Kata {
      public static boolean[] populateBathroom(boolean[] urinals, int numOfPeople) {
        return new boolean[] {true, false, true};
      }
    }
  • 11
    public class Kata {
    
    22
      public static boolean[] populateBathroom(boolean[] urinals, int numOfPeople) {
    
    3
        // Implement the urinal problem, described as "given x number of people walking 
    
    4
        // into a bathroom that contains y number of urinals, describe the optimate
    
    5
        // placement of people so that none is standing next to the other"
    
    6
        // In this case, the urinals are represented by a boolean array with 
    
    7
        // true representing a person at a urinal, and false meaning the urinal is empty
    
    88
        return new boolean[] {true, false, true};
    
    99
      }
    
    1010
    }