Begin a new Kumite
Search
About
  • Filter by Language:
  • 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.

Code
Diff
  • var add1 = 0;
    var add2 = 0;
    
    var minus1 = 0;
    var minus2 = 0;
    
    var times1 = 0;
    var times2 = 0;
    
    var exponet1 = 0;
    var exponet2 = 0;
    
    var divide1 = 0;  //Division with decimal
    var divide2 = 0;
    
    var divide3 = 0; //Division with remainder
    var divide4 = 0;
    
    var y = 15;
    console.log( add1  + add2 +" (Addition)");
    var y = 35;
    console.log( minus1 - minus2 +" (Subtraction)" ); 
    var y = 55;
    console.log( times1 * times2  +" (Multilplication)" ); 
    var y = 75;
    console.log( divide1 / divide2 +" (Division with decimal)" ); 
    var y = 95;
    console.log( Math.floor (divide3 / divide4) + " R" + divide3 % divide4 +" (Division with remainder)"); 
    var y = 115;
    console.log( Math.pow(exponet2, exponet1) + " (Exponent) ");
    
    
  • 1
    // The operation with the number "1" goes first
    
    2
    var add1 = 0
    
    3
    var add2 = 0
    
    1+
    var add1 = 0;
    
    2+
    var add2 = 0;
    
    44
    5
    var minus1 = 0
    
    6
    var minus2 = 0
    
    4+
    var minus1 = 0;
    
    5+
    var minus2 = 0;
    
    77
    8
    var divide1 = 0
    
    9
    var divide2 = 0
    
    7+
    var times1 = 0;
    
    8+
    var times2 = 0;
    
    1010
    11
    var times1 = 0
    
    12
    var times2 = 0
    
    13
    //change the numbers in the varibles above
    
    10+
    var exponet1 = 0;
    
    11+
    var exponet2 = 0;
    
    12+
    13+
    var divide1 = 0;  //Division with decimal
    
    14+
    var divide2 = 0;
    
    15+
    16+
    var divide3 = 0; //Division with remainder
    
    17+
    var divide4 = 0;
    
    18+
    19+
    var y = 15;
    
    20+
    console.log( add1  + add2 +" (Addition)");
    
    21+
    var y = 35;
    
    22+
    console.log( minus1 - minus2 +" (Subtraction)" ); 
    
    23+
    var y = 55;
    
    24+
    console.log( times1 * times2  +" (Multilplication)" ); 
    
    25+
    var y = 75;
    
    26+
    console.log( divide1 / divide2 +" (Division with decimal)" ); 
    
    27+
    var y = 95;
    
    28+
    console.log( Math.floor (divide3 / divide4) + " R" + divide3 % divide4 +" (Division with remainder)"); 
    
    29+
    var y = 115;
    
    30+
    console.log( Math.pow(exponet2, exponet1) + " (Exponent) ");
    
    1414
    15
    console.log("Addition" , add1 + add2) //Addition
    
    16
    17
    console.log("Subtraction", minus1-minus2) //Subtraction
    
    18
    19
    console.log("Division" , divide1/divide2) //Division
    
    20
    21
    console.log("Multiplication" , times1*times2) //Multiplication
    
export function validateString(input: string, index: number, stack: number = 0): boolean {
  // TODO: your code
  if(index === 0 && (input[index] === ')' | input[index] === '}' | input[index] === ']')) {
    return false;
  }
    
  if(input[index] === '(' | input[index] === '{' | input[index] === '[') {
    stack++;
  }
  
  validateString(input, index + 1, )
  
}
Strings
Arrays
Code
Diff
  • def Special_Fission(input):
        return list(filter(lambda letter: letter.isalpha(), input))
  • 11
    def Special_Fission(input):
    
    2
        return [i for i in input if i.isalpha()]
    
    2+
        return list(filter(lambda letter: letter.isalpha(), input))
    

Recent Moves:

Fundamentals
Strings

The Romanian alphabet is the 31-letter alphabet of the modern Romanian language. It consists of the 26 letters of the Latin alphabet, plus 5 special characters obtained by applying diacritics.

Your task is to change the letters with diacritics:

Ă ă —> a

 ⠗> a

Î î —> i

Ș ș —> s

Ț ț —> t

For example:

Vlad Țepeș --> Vlad Tepes

def correct_romanian_letters(word): 
    return word.translate(str.maketrans("ĂăÂâÎîȘșȚț","AaAaIiSsTt"))

Ascii 'A' is single byte. = {65}
Unicode 'A' is double byte 'A' = {0,65}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

unsigned short *AsciiToUnicode( unsigned char *ascii);

unsigned short *AsciiToUnicode( unsigned char *ascii){
  int len = strlen((const char *)ascii);
  unsigned short *ptr = NULL;
  
  ptr = (unsigned short *)malloc(len);
  memset(ptr, 0, len);
  
  for (int i = 0; i < len; i++){
    *(ptr + i) = *(ascii + i);
  }
    
  return ptr;
}

int main(){
  unsigned short *unicode = AsciiToUnicode((unsigned char *)"ABC");
  
  for (unsigned short i=0; *(unicode+i); i++){
    printf("%c ", (unsigned char) *(unicode+i));
  }
  free(unicode);
  return 0;
}
Arrays
Objects
Code
Diff
  • function mapOrder(array, order, key) {
      if (!Array.isArray(array)) return [];
      
      const lookupTablea = array.reduceRight((table, o) => table.set(o[key], o), new Map());
      
      return order.map(k => lookupTablea.get(k));
    }
  • 11
    function mapOrder(array, order, key) {
    
    22
      if (!Array.isArray(array)) return [];
    
    33
      
    
    4
      const lookupTable = array.reduceRight((table, o) => table.set(o[key], o), new Map());
    
    4+
      const lookupTablea = array.reduceRight((table, o) => table.set(o[key], o), new Map());
    
    55
      
    
    6
      return order.map(k => lookupTable.get(k));
    
    6+
      return order.map(k => lookupTablea.get(k));
    
    77
    }