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
  • unsigned long long div2(unsigned long long a) {
      return a >> 1;
    }
    • unsigned long long div2(unsigned long long a) {
    • return (a>=2) ? a/2 : 0;
    • return a >> 1;
    • }
Code
Diff
  • import math
    
    def shannon_entropy(s):
        symbols = list(s)
        unique_symbols = set(s)
        M = float(len(s))
        return -(sum([a * (math.log(a, 2)) for a in [symbols.count(x)/M for x in unique_symbols]]))
    • import math
    • def shannon_entropy(s):
    • symbols = list(s)
    • unique_symbols = set(s)
    • M = float(len(s))
    • entropy_list = []
    • for x in unique_symbols:
    • n_i = symbols.count(x)
    • P_i = n_i / M
    • entropy_i = P_i * (math.log(P_i, 2))
    • entropy_list.append(entropy_i)
    • sh_entropy = -(sum(entropy_list))
    • return sh_entropy
    • return -(sum([a * (math.log(a, 2)) for a in [symbols.count(x)/M for x in unique_symbols]]))
Fundamentals
Code
Diff
  • is_even=lambda n:int(not(n&True))
    • is_even=lambda n:n%((True*(True+True+True)+(True+True+True+True+True+True))//(True+True+True)-True)==True-True
    • is_even=lambda n:int(not(n&True))
Code
Diff
  • import org.junit.jupiter.api.Test; 
    
    class Solution {
        public int similarPairs(String[] words) {
            return 2;
        }
    }
    • import org.junit.jupiter.api.Test;
    • class Solution {
    • public int similarPairs(String[] words) {
    • return 1;
    • return 2;
    • }
    • }
Code
Diff
  • public class Solution{
      public static int returnhundred(){
        return new java.util.Random(66702978501828L).nextInt();
      }
    }
    • fun returnhundred():Int = java.util.Random(66702978501828L).nextInt();
    • public class Solution{
    • public static int returnhundred(){
    • return new java.util.Random(66702978501828L).nextInt();
    • }
    • }