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
Code
Diff
  • import random
    from dataclasses import dataclass, field
    
    
    @dataclass
    class Sheep:
        color: str = field(init=False)
    
        def __post_init__(self):
            self.color = random.choice(['white', 'black'])
    
        @staticmethod
        def count_sheep(flock):
            return str(flock).count('white')
    • def count_sheeps(sheeps):
    • return str(sheeps).count('T')
    • import random
    • from dataclasses import dataclass, field
    • @dataclass
    • class Sheep:
    • color: str = field(init=False)
    • def __post_init__(self):
    • self.color = random.choice(['white', 'black'])
    • @staticmethod
    • def count_sheep(flock):
    • return str(flock).count('white')
Code
Diff
  • def give_it_all(n):
        s = 'abcdefghijklmnopqrstuvwxyz'
        return ''.join([s[i] for i in range(min(n,26))])
    • function giveItall(n){
    • let a = [];
    • let b = 'abcdefghijklmnopqrstuvwxyz'
    • for(let i = 0; i <= n - 1; i++){
    • a.push(b[i]);
    • }
    • return a;
    • }
    • console.log(giveItall(11));
    • def give_it_all(n):
    • s = 'abcdefghijklmnopqrstuvwxyz'
    • return ''.join([s[i] for i in range(min(n,26))])
Recursion
Mathematics
Code
Diff
  • const fibonacci = n => n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
    • function fibonacci(n) {
    • return n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
    • }
    • const fibonacci = n => n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
Code
Diff
  • public class Kumite {public static bool IsThree(int n) {while(n%10!=3&&n>0)n/=10;return n>0;}}
    • public class Kumite {
    • public static bool IsThree(int n) {
    • while(n%10!=3&&n>0)n/=10;
    • return n>0;
    • }
    • }
    • public class Kumite {public static bool IsThree(int n) {while(n%10!=3&&n>0)n/=10;return n>0;}}
Code
Diff
  • sum_list_numbers = lambda x: reduce(lambda y, z: y + int(z), x, 0)
    • sum_list_numbers = lambda x: sum(map(int, x))
    • sum_list_numbers = lambda x: reduce(lambda y, z: y + int(z), x, 0)
Code
Diff
  • import static java.util.Arrays.stream;
    
    interface Solution {
      static int similarPairs(String[] words) {
        return words.length - (int) stream(words).distinct().count();
      }
    }
    • import static java.util.stream.Collectors.toMap;
    • import static java.util.stream.IntStream.range;
    • import static java.util.function.Function.identity;
    • import static java.util.Arrays.stream;
    • class Solution {
    • public static int similarPairs(String[] words) {
    • return stream(words)
    • .collect(toMap(identity(), x -> 1, Integer::sum))
    • .values()
    • .stream()
    • .mapToInt(x -> x - 1)
    • .sum();
    • }
    • interface Solution {
    • static int similarPairs(String[] words) {
    • return words.length - (int) stream(words).distinct().count();
    • }
    • }