Start a new Kumite
AllAgda (Beta)BF (Beta)CCFML (Beta)ClojureCOBOL (Beta)CoffeeScriptCommonLisp (Beta)CoqC++CrystalC#D (Beta)DartElixirElm (Beta)Erlang (Beta)Factor (Beta)Forth (Beta)Fortran (Beta)F#GoGroovyHaskellHaxe (Beta)Idris (Beta)JavaJavaScriptJulia (Beta)Kotlinλ Calculus (Beta)LeanLuaNASMNim (Beta)Objective-C (Beta)OCaml (Beta)Pascal (Beta)Perl (Beta)PHPPowerShell (Beta)Prolog (Beta)PureScript (Beta)PythonR (Beta)RacketRaku (Beta)Reason (Beta)RISC-V (Beta)RubyRustScalaShellSolidity (Beta)SQLSwiftTypeScriptVB (Beta)
Show only mine

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.

Ad
Ad
public class Kata {
    public static boolean findStringInString(String a, String b) {
        // Return whether String A is found in String B
        return false;
    }
}
public class Kata {
    public static int findIndex (int[] my_array, int t) {
        // Find the index of t
        return 4;
    }
}
public class Kata {
    public static int[] sortValues(int[] my_array, int size) {
        // Given an array of size N containing only 0s, 1s, and 2s; 
        // sort the array in ascending order.
        int[] returnArray = {0,0,0,0,1,1,2,2};
        return returnArray;
    }
}

I alayws! have to search for this thing and figured it would be a blessing for somebody else out there too!

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

public class Dictionary {

	public static int Upsert() {
    
		Dictionary<string, int> dictionary = new Dictionary<string, int>();
		dictionary["upsert"] = dictionary.GetValueOrDefault("uspert", 0) + 1;

    return dictionary["upsert"];
	}
}
Algorithms
Logic

Simple, get every nth word in a string.
Trying to optimize it. Words are split by a single space " ".
Does not start with the first word.

decode("Hello World", 2) -> "World"

decode("1 2 3 4 5 6 7 8 9", 3) -> "3 6 9"

decode("Lorem ipsum dolor sit amet", 1) -> "Lorem ipsum dolor sit amet"

decode("There aren't enough words.", 5) -> ""

def get_nth_words(string, n):
    if n < 1: return ""
    return ' '.join(['',*string.split()][::n][1:])
import java.util.*;

public class Kata {
  
    private LinkedList<String> linkedList;
  
    public static void AddItem(String itemToAdd, String whereToAddIt) {
         // When given a string, whereToAddIt, find that string
         // in the LinkedList and add itemToAdd directly after whereToAddIt
         // in the LinkedList
    }
    
    public static void RemoveItem(String whereToRemoveIt) {
         // When given a string, whereToRemoveIt, find that string
         // in the LinkedList and remove it from the linked list
    }
  
    public static void MergeLists(LinkedList<String> listToMerge) {
         // Merge this linked list with the previous
    }
    
}
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 7;
    }
}
import static java.util.stream.DoubleStream.of;
import static org.apache.commons.lang3.ArrayUtils.reverse;

interface DeleteDuplicates {
  static double[] deleteDups(double[] a) {
     // Given an array, eliminate duplicate values and return the array 
     return a;
  }
}

// Change min and max below to be the highest and lowest values
// in the nums array provided to the function

interface HighLow {
    static int[] findLargestAndSmallest(int[] nums) {
        // Change min and max below to be the highest and lowest values
        // in the nums array provided to the function
        int min = 0;  
        int max = 100;
        return new int[]{min, max};
    }
}

Find the max number of times an integer occurs in an array.

import java.util.Arrays;

class MaxOccurence {

  
  public static int findMax(int[] nums) {

      
      return 5;
  }
}