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
  • using System.Collections.Generic;
    using System.Linq;
    public class Kata
    {
        /// <summary>
        /// Checks if two char arrays contain at least one common item.
        /// </summary>
        /// <param name="a">First char array</param>
        /// <param name="b">Second char array</param>
        /// <returns>True if the arrays have at least one common item, false otherwise</returns>
        public static bool ContainsCommonItem(char[] a, char[] b)=>a == null || b == null ? false : a.Intersect(b).Any();
        
    }
    
    • using System.Collections.Generic;
    • using System.Linq;
    • public class Kata
    • {
    • /// <summary>
    • /// Checks if two char arrays contain at least one common item.
    • /// </summary>
    • /// <param name="a">First char array</param>
    • /// <param name="b">Second char array</param>
    • /// <returns>True if the arrays have at least one common item, false otherwise</returns>
    • public static bool ContainsCommonItem(char[] a, char[] b)
    • {
    • // If either input array is null, return false
    • if (a == null || b == null) return false;
    • return a.Intersect(b).Any();
    • }
    • public static bool ContainsCommonItem(char[] a, char[] b)=>a == null || b == null ? false : a.Intersect(b).Any();
    • }
Code
Diff
  • using System;
    
    public class RomanDecode
    {
      public static int GetCharacter(char character) {
        switch (character) {
            case 'I': return 1;
            case 'V': return 5;
            case 'X': return 10;
            case 'L': return 50;
            case 'C': return 100;
            case 'D': return 500;
            case 'M': return 1000;
            default: throw new NotImplementedException();
        }  
      }
      
    	public static int Solution(string roman)
    	{
    		var result = 0;
        var lastCharacter = 0;
        for (var i = roman.Length - 1; i >= 0; i--) {
          var character = GetCharacter(roman[i]);
          if (character >= lastCharacter) {
            result += character;
          } else {
            result -= character;
          }
          lastCharacter = character;
        }
        return result;
    	}
    }
    • package kata
    • using System;
    • func Decode(roman string) int {
    • return 0
    • public class RomanDecode
    • {
    • public static int GetCharacter(char character) {
    • switch (character) {
    • case 'I': return 1;
    • case 'V': return 5;
    • case 'X': return 10;
    • case 'L': return 50;
    • case 'C': return 100;
    • case 'D': return 500;
    • case 'M': return 1000;
    • default: throw new NotImplementedException();
    • }
    • }
    • public static int Solution(string roman)
    • {
    • var result = 0;
    • var lastCharacter = 0;
    • for (var i = roman.Length - 1; i >= 0; i--) {
    • var character = GetCharacter(roman[i]);
    • if (character >= lastCharacter) {
    • result += character;
    • } else {
    • result -= character;
    • }
    • lastCharacter = character;
    • }
    • return result;
    • }
    • }
Code
Diff
  • function addArr(arr){  
      return arr.reduce((sum, num) => sum + num, 0) || null
    }
    • function addArr(arr){
    • if(arr.length === 0) return null
    • let final = 0
    • arr.forEach(num => {
    • final += num
    • })
    • return final
    • function addArr(arr){
    • return arr.reduce((sum, num) => sum + num, 0) || null
    • }
Code
Diff
  • -- Code Here
    select
      d.city_name as kota,
      sum(c.confirmed_cases) as confirmed_cases,
      sum(c.recovered_cases) as recovered_cases,
      sum(c.death_cases) as death_cases
    from cases c
    left join dati d
    on d.code = c.dati_code
    group by 1
    order by 2 desc
    • --- Code Here
    • -- Code Here
    • select
    • d.city_name as kota,
    • sum(c.confirmed_cases) as confirmed_cases,
    • sum(c.recovered_cases) as recovered_cases,
    • sum(c.death_cases) as death_cases
    • from cases c
    • left join dati d
    • on d.code = c.dati_code
    • group by 1
    • order by 2 desc
Code
Diff
  • def дима_лох():
        return 'w - h - y'
    • def why():
    • def дима_лох():
    • return 'w - h - y'
Code
Diff
  • def should_return_1():
        a = 2 - 1
        return a
    • def should_return_1():
    • return 1
    • a = 2 - 1
    • return a
Code
Diff
  • -- Code Here
    SELECT * FROM employees
    ORDER BY salary DESC
    LIMIT 10
    • --- Code Here
    • -- Code Here
    • SELECT * FROM employees
    • ORDER BY salary DESC
    • LIMIT 10
Code
Diff
  • -- Code Here
    SELECT *
    FROM transactions
    WHERE customer IS NOT NULL
    ORDER BY store, total_price DESC
    • --- Code Here
    • -- Code Here
    • SELECT *
    • FROM transactions
    • WHERE customer IS NOT NULL
    • ORDER BY store, total_price DESC
Code
Diff
  • -- Code Here
    SELECT*FROM transactions
    order by total_price DESC;
    • --- Code Here
    • -- Code Here
    • SELECT*FROM transactions
    • order by total_price DESC;