Search
• ###### 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.

### Opposite number

Fundamentals

Very simple, given a number, find its opposite.

Examples:

1: -1
14: -14
-34: 34

``````using System;

public class Kata
{
public  static int Opposite(int number)
{
// Happy Coding
return number*-1;
}
}``````

### Russian Exam Task 25 (1)

Algorithms
Mathematics
Numbers

Code
Diff
• `````` using System;
using System.Linq;
public class RussianExam
{
{
var multiplesOfThreeCount = array.Where(y => y % 3 == 0).Count();
return array.Select(x => IsOddMultipleOfThree(x) ? multiplesOfThreeCount : x).ToArray();
}

private static bool IsOddMultipleOfThree(int x)
{
return x % 3 == 0 && x % 2 != 0;
}
}
``````
•  1 1 ``` using System; ``` 2 2 ``` using System.Linq; ``` 3 3 ```public class RussianExam ``` 4 4 ``` { ``` 5 5 ``` public static int[] ExamTask(int[] array) ``` 6 6 ``` { ``` 7 − ``` return array.Select(x => x % 3 == 0 && x % 2 != 0 ? (x = array.Where(y => y % 3 == 0).Count()) : x=x).ToArray(); ``` 7 + ``` var multiplesOfThreeCount = array.Where(y => y % 3 == 0).Count(); ``` 8 + ``` return array.Select(x => IsOddMultipleOfThree(x) ? multiplesOfThreeCount : x).ToArray(); ``` 9 + ``` } ``` 10 + ``` ``` 11 + ``` private static bool IsOddMultipleOfThree(int x) ``` 12 + ``` { ``` 13 + ``` return x % 3 == 0 && x % 2 != 0; ``` 8 8 ``` } ``` 9 9 ``` } ```

Recent Moves:

### Bioinformatics - The Reverse Compliment

Code
Diff
• ``reverse_compliment = lambda dna: dna.translate(dna.maketrans("ACGTacgt", "TGCATGCA"))[::-1]``
•  1 − ```def reverse_compliment(dna): ``` 2 − ``` # ensure input is in upper case so replace works correctly ``` 3 − ``` uppercase_dna = dna.upper() ``` 4 − ``` # chain compliment replacements, convert to upper case & reverse return value ``` 5 − ``` return ( ``` 6 − ``` uppercase_dna.replace("T", "a") ``` 7 − ``` .replace("A", "t") ``` 8 − ``` .replace("C", "g") ``` 9 − ``` .replace("G", "c") ``` 10 − ``` .upper()[::-1] ``` 11 − ``` ) ``` 1 + ```reverse_compliment = lambda dna: dna.translate(dna.maketrans("ACGTacgt", "TGCATGCA"))[::-1] ```

Recent Moves:

### Factorial

Given a number n, it is your job to multiply the n by all the numbers that are below it stopping at 1.
So if n = 3 then the output should be 3 * 2 * 1 = 6

``````fun fact(n: Int): Int {
var fact = 1
var check = n
while(check > 0) {
fact *= check
check--
}
return fact
}``````
Failed Tests

### stɛffan153's Kumite #2546

Kumite shouldn't count comment markers and comments as lines of code.

Code
Diff
• ``// ``
•  1 − ```console.log(""); ``` 1 + ```// ```

Recent Moves: