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
  • SELECT * FROM customers 
    WHERE customers.kota='Tasikmalaya'
    • -- Code here
    • SELECT * FROM customers
    • WHERE customers.kota='Tasikmalaya'
Code
Diff
  • SELECT customers.name, customers.age FROM customers
    • -- Code Here
    • SELECT customers.name, customers.age FROM customers
Code
Diff
  • const addArr = arr => arr.reduce((acc, curr) => acc + curr, null);
    
    • const addArr = (arr) => {
    • let sum = 0;
    • for (let i = 0; i < arr.length; i++) {
    • sum += arr[i];
    • }
    • return sum || null;
    • };
    • const addArr = arr => arr.reduce((acc, curr) => acc + curr, null);
Code
Diff
  • -- Code Here
    SELECT date,store,total_price 
    FROM transactions
    WHERE date >= '2022-01-01' AND date <= '2022-01-03'
    • --- Code Here
    • -- Code Here
    • SELECT date,store,total_price
    • FROM transactions
    • WHERE date >= '2022-01-01' AND date <= '2022-01-03'
Code
Diff
  • -- Code Here
    SELECT  * 
      FROM transactions
      WHERE store 
            NOT IN ('BIE Store Jakarta','BIE Store Bandung')
    • --- Code Here
    • -- Code Here
    • SELECT *
    • FROM transactions
    • WHERE store
    • NOT IN ('BIE Store Jakarta','BIE Store Bandung')
Code
Diff
  • SELECT*FROM customers
    
    • -- Code here
    • SELECT*FROM customers

I added a couple (1000) tests, Code:

fn main() {
    for i in 0..1000 {
		    print_equal(i, solution(i));
	  }
}

fn print_equal(num: i32, right: bool) {
	  println!("    #[test]");
	  println!("    fn fixed_test_{num}() {{");
    println!("          assert_eq!(solution({num}), {right});");
	  println!("    }}");
}

fn solution(x: i32) -> bool {
    x.to_string().contains('3')
}
Code
Diff
  • def find_max(arr):
        return max(arr)
    • def find_max(arr):
    • return 0
    • return max(arr)
Mathematics
Algorithms
Logic
Numbers
Code
Diff
  • def prime_checker(n):
        if n in [2, 3, 5]:
            return True
        elif n % 2 == 0 or n % 3 == 0 or n % 5 == 0:
            return False
        
        a = int(n ** 0.5 / 30)
        b = [7, 11, 13, 17, 19, 23, 29, 31]
        
        for i in [30 * j for j in range(a + 1)]:
            if True in [n % (i + q) == 0 for q in b if i + q is not n]:
                return False
        return True 
    • """
    • https://en.wikipedia.org/wiki/Primality_test
    • This one has lesser tests or usage of % operator.
    • An alternative using primality mod 30 = 2 * 3 * 5 instead of 6 = 2 * 3
    • """
    • def prime_checker(n):
    • if n in [2, 3, 5]:
    • return True
    • elif n % 2 == 0 or n % 3 == 0 or n % 5 == 0:
    • return False
    • a = int(n ** 0.5 / 30)
    • b = [7, 11, 13, 17, 19, 23, 29, 31]
    • for i in [30 * j for j in range(a + 1)]:
    • if True in [n % (i + q) == 0 for q in b if i + q is not n]:
    • return False
    • return True
Code
Diff
  • returnhundred() = parse(Int, string(VERSION)[end]) * 2 * 5 * 3 + 2 * 5
    • function returnhundred() {
    • return 10 ** 2;
    • }
    • returnhundred() = parse(Int, string(VERSION)[end]) * 2 * 5 * 3 + 2 * 5