meetforever/GRPO_CL huggingface dataset:
user: Gray code is a form of binary encoding where transitions between consecutive numbers differ by only one bit. This is a useful encoding for reducing hardware data hazards with values that change rapidly and/or connect to slower hardware as inputs. It is also useful for generating inputs for Karnaugh maps.

Here is an exemple of what the code look like:

```
0:    0000
1:    0001
2:    0011
3:    0010
4:    0110
5:    0111
6:    0101
7:    0100
8:    1100
```

The goal of this kata is to build two function bin2gray and gray2bin wich will convert natural binary to Gray Code and vice-versa. We will use the "binary reflected Gray code". The input and output will be arrays of 0 and 1, MSB at index 0.

There are "simple" formula to implement these functions. It is a very interesting exercise to find them by yourself.

All input will be correct binary arrays.

Answer: {"fn_name": "bin2gray", "inputs": [[[1, 0, 1]], [[1, 1]], [[1]], [[0]], [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0]], [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0]]], "outputs": [[[1, 1, 1]], [[1, 0]], [[1]], [[0]], [[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1]], [[1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1]]]}
user: You are going to be given a string. Your job is to return that string in a certain order that I will explain below:

Let's say you start with this: `012345`

The first thing you do is reverse it:`543210`  
Then you will take the string from the 1st position and reverse it again:`501234`  
Then you will take the string from the 2nd position and reverse it again:`504321`  
Then you will take the string from the 3rd position and reverse it again:`504123`

Continue this pattern until you have done every single position, and then you will return the string you have created. For this particular number, you would return:`504132`

#Input:
A string of length 1 - 1000

#Output:
A correctly reordered string.

Answer: {"fn_name": "reverse_fun", "inputs": [["012"], ["012345"], ["0123456789"], ["Hello"]], "outputs": [["201"], ["504132"], ["9081726354"], ["oHlel"]]}
user: You are trying to cross a river by jumping along stones. Every time you land on a stone, you hop forwards by the value of that stone. If you skip *over* a stone then its value doesn't affect you in any way. Eg:

```
 x--x-----x-->
[1][2][5][1]

```

Of course, crossing from the other side might give you a different answer:

```
 <--------x--x
   [1][2][5][1]

```

Given an array of positive integers, return the total number of steps it would take to go all the way across the river (and past the end of the array) and then all the way back. All arrays will contain at least one element, and may contain up to 100 elements. 

### Examples

```
  x--x-----x-->
 [1][2][1][2]
<----x-----x

therefore hop_across([1,2,1,2]) = 3 + 2 = 5

   x-----x--------x------>
  [2][2][3][1][1][2][1]
<--------x--x-----x--x

therefore hop_across([2,2,3,1,1,2,1]) = 3 + 4 = 7

```

Answer: {"fn_name": "hop_across", "inputs": [[[1]], [[2]], [[1, 1]], [[2, 1]], [[2, 1, 1]], [[1, 2, 1, 2]], [[1, 2, 5, 1]], [[2, 2, 3, 1, 1, 2, 1]]], "outputs": [[2], [2], [4], [3], [5], [5], [5], [7]]}
user: Check if given numbers are prime numbers. 
If number N is prime ```return "Probable Prime"``` else ``` return "Composite"```. 
HINT: Upper bount is really big so you should use an efficient algorithm.

Input
  1 < N ≤ 10^(100)

Example
  prime_or_composite(2)  # should return Probable Prime
  prime_or_composite(200)  # should return Composite

Answer: {"fn_name": "prime_or_composite", "inputs": [[2], [3], [5], [9], [12]], "outputs": [["Probable Prime"], ["Probable Prime"], ["Probable Prime"], ["Composite"], ["Composite"]]}
user: # Task
 You are given an array of integers `a` and a non-negative number of operations `k`, applied to the array. Each operation consists of two parts:
```
find the maximum element value of the array;
replace each element a[i] with (maximum element value - a[i]).```
How will the array look like after `k` such operations?

# Example

 For `a = [-4, 0, -1, 0]` and `k = 2`, the output should be `[0, 4, 3, 4]`.
 ```
 initial array: [-4, 0, -1, 0]
 1st operation: 
 find the maximum value --> 0
 replace each element:  --> [(0 - -4), (0 - 0), (0 - -1), (0 - 0)]
                        --> [4, 0, 1, 0]
 2nd operation: 
 find the maximum value --> 4
 replace each element:  --> [(4 - 4), (4 - 0), (4 - 1), (4 - 0)]
                        --> [0, 4, 3, 4]
 
 ```
 For `a = [0, -1, 0, 0, -1, -1, -1, -1, 1, -1]` and `k = 1`, 
 
 the output should be `[1, 2, 1, 1, 2, 2, 2, 2, 0, 2]`.
 ```
 initial array: [0, -1, 0, 0, -1, -1, -1, -1, 1, -1]
 1st operation: 
 find the maximum value --> 1
 replace each element:  -->
 [(1-0),(1- -1),(1-0),(1-0),(1- -1),(1- -1),(1- -1),(1- -1),(1-1),(1- -1)]
--> [1, 2, 1, 1, 2, 2, 2, 2, 0, 2]
 ```

# Input/Output


 - `[input]` integer array a

    The initial array.

    Constraints: 

    `1 <= a.length <= 100`
    
    `-100 <= a[i] <= 100`


 - `[input]` integer `k`

    non-negative number of operations.

    Constraints: `0 <= k <= 100000`


 - [output] an integer array

    The array after `k` operations.

Answer: {"fn_name": "array_operations", "inputs": [[[-4, 0, -1, 0], 2], [[0, -1, 0, 0, -1, -1, -1, -1, 1, -1], 1], [[-1], 10000]], "outputs": [[[0, 4, 3, 4]], [[1, 2, 1, 1, 2, 2, 2, 2, 0, 2]], [[0]]]}
user: Let’s get to know our hero: Agent #134 - Mr. Slayer.

He was sent by his CSV agency to Ancient Rome in order to resolve some important national issues. However, something incredible has happened - the enemies have taken Julius Caesar as a prisoner!!!

Caesar, not a simple man as you know, managed to send cryptic message with coordinates of his location hoping that somebody would break the code. Here our agent of the secret service comes to the stage.

But he needs your help!

**Mission:**

You have to implement the function “Encode” of CaesarCrypto class that codes or decodes text based on Caesar’s algorithm.the function receives 2 parameters: an original text of any length of type “string” and a number of type “int” that represents shifts;only letters in both cases must be encrypted;alphabet contains only letters in this range: a-zA-Z;by encryption the letter can change the case;shift could be either positive or negative (for left shift);If the input text is empty, null or includes only whitespaces, return an empty string.

Time's ticking away. The life of Caesar is on the chopping block! Go for it!

Answer: {"fn_name": "caesar_crypto_encode", "inputs": [["123,.)(!?", 10], ["", 10], [null, 10], ["   ", 10], ["Hello world!", 127], ["eBIIL TLOIA!", -127], ["ksdjai8983hdk?}{", 15], ["Hello world!", 0]], "outputs": [["123,.)(!?"], [""], [""], [""], ["eBIIL TLOIA!"], ["Hello world!"], ["zHsypx8983wsz?}{"], ["Hello world!"]]}
user: # Task
 Consider the following operation:
 
 We take a positive integer `n` and replace it with the sum of its `prime factors` (if a prime number is presented multiple times in the factorization of `n`, then it's counted the same number of times in the sum). 
 
 This operation is applied sequentially first to the given number, then to the first result, then to the second result and so on.., until the result remains the same.

  Given number `n`, find the final result of the operation.

# Example

  For `n = 24`, the output should be `5`.
```
24 -> (2 + 2 + 2 + 3) = 9 -> (3 + 3) = 6 -> (2 + 3) = 5 -> 5.
So the answer for n = 24 is 5.```

# Input/Output


 - `[input]` integer `n`

  Constraints: `2 ≤ n ≤ 10000.`


 - `[output]` an integer

Answer: {"fn_name": "factor_sum", "inputs": [[24], [35], [156], [4], [31]], "outputs": [[5], [7], [5], [4], [31]]}
user: Create your own mechanical dartboard that gives back your score based on the coordinates of your dart.

Task:

Use the scoring rules for a standard dartboard:


Finish method:

```python
def get_score(x,y):
```

The coordinates are `(x, y)` are always relative to the center of the board (0, 0). The unit is millimeters. If you throw your dart 5 centimeters to the left and 3 centimeters below, it is written as:

```python
score = get_score(-50, -30)
```

Possible scores are:Outside of the board: `"X"`Bull's eye: `"DB"`Bull: `"SB"`A single number, example: `"10"`A triple number: `"T10"`A double number: `"D10"`
A throw that ends exactly on the border of two sections results in a bounce out. You can ignore this because all the given coordinates of the tests are within the sections.
The diameters of the circles on the dartboard are:Bull's eye: `12.70 mm`Bull: `31.8 mm`Triple ring inner circle: `198 mm`Triple ring outer circle: `214 mm`Double ring inner circle: `324 mm`Double ring outer circle: `340 mm`

If you liked this kata, you can continue with: Let's Play Darts: Beat The Power!

Answer: {"fn_name": "get_score", "inputs": [[-133.69, -147.38], [4.06, 0.71], [2.38, -6.06], [-5.43, 117.95], [-73.905, -95.94], [55.53, -87.95], [-145.19, 86.53]], "outputs": [["X"], ["DB"], ["SB"], ["20"], ["7"], ["T2"], ["D9"]]}
user: Mothers arranged a dance party for the children in school. At that party, there are only mothers and their children. All are having great fun on the dance floor when suddenly all the lights went out. It's a dark night and no one can see each other. But you were flying nearby and you can see in the dark and have ability to teleport people anywhere you want.

Legend:
-Uppercase letters stands for mothers, lowercase stand for their children, i.e. "A" mother's children are "aaaa".
-Function input: String contains only letters, uppercase letters are unique.
Task:
Place all people in alphabetical order where Mothers are followed by their children, i.e. "aAbaBb" => "AaaBbb".

Answer: {"fn_name": "find_children", "inputs": [["abBA"], ["AaaaaZazzz"], ["CbcBcbaA"], ["xXfuUuuF"], [""]], "outputs": [["AaBb"], ["AaaaaaZzzz"], ["AaBbbCcc"], ["FfUuuuXx"], [""]]}
user: Create a __moreZeros__ function which will __receive a string__ for input, and __return an array__ (or null terminated string in C) containing only the characters from that string whose __binary representation of its ASCII value__ consists of _more zeros than ones_. 

You should __remove any duplicate characters__, keeping the __first occurence__ of any such duplicates, so they are in the __same order__ in the final array as they first appeared in the input string.

Examples

            
All input will be valid strings of length > 0. Leading zeros in binary should not be counted.

Answer: {"fn_name": "more_zeros", "inputs": [["abcde"], ["thequickbrownfoxjumpsoverthelazydog"], ["THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG"], ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_"], ["DIGEST"], ["abcdabcd"], ["Forgiveness is the fragrance that the violet sheds on the heal that has crushed it"]], "outputs": [[["a", "b", "d"]], [["h", "b", "p", "a", "d"]], [["T", "H", "E", "Q", "I", "C", "B", "R", "F", "X", "J", "P", "L", "A", "D"]], [["a", "b", "d", "h", "p", "A", "B", "C", "D", "E", "F", "H", "I", "J", "L", "P", "Q", "R", "T", "X", "0"]], [["D", "I", "E", "T"]], [["a", "b", "d"]], [["F", " ", "h", "a", "d"]]]}
user: ## Sum Even Fibonacci Numbers

* Write a func named SumEvenFibonacci that takes a parameter of type int and returns a value of type int

* Generate all of the Fibonacci numbers starting with 1 and 2 and ending on the highest number before exceeding the parameter's value 


#### Each new number in the Fibonacci sequence is generated by adding the previous two numbers - by starting with 1 and 2(the input could be smaller), the first 10 numbers will be:


```
 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
```

* Sum all of the even numbers you generate and return that int

#### Example:

```
sumEvenFibonacci(8) // returns 10 by adding the even values 2 and 8
```

Answer: {"fn_name": "SumEvenFibonacci", "inputs": [[1], [2], [8], [111111], [8675309], [144100000], [65140000], [7347000000], [10000000000000], [123456789000000]], "outputs": [[0], [2], [10], [60696], [4613732], [82790070], [82790070], [6293134512], [8583840088782], [154030760585064]]}
user: Get n seconds before the target time. See Example Test Cases about the format.

Answer: {"fn_name": "seconds_ago", "inputs": [["2000-01-01 00:00:00", 1], ["0001-02-03 04:05:06", 7]], "outputs": [["1999-12-31 23:59:59"], ["0001-02-03 04:04:59"]]}
user: We have a matrix of integers with m rows and n columns.



We want to calculate the total sum for the matrix:



As you can see, the name "alternating sum" of the title is due to the sign of the terms that changes from one term to its contiguous one and so on.

Let's see an example:
```
matrix = [[1, 2, 3], [-3, -2, 1], [3, - 1, 2]]

total_sum = (1 - 2 + 3) + [-(-3) + (-2) - 1] + [3 - (-1) + 2] = 2 + 0 + 6 = 8
```
You may be given matrixes with their dimensions between these values:```10 < m < 300``` and ```10 < n < 300```.

More example cases in the Example Test Cases.
Enjoy it!!

Answer: {"fn_name": "score_matrix", "inputs": [[[[1, 2, 3], [-3, -2, 1], [3, -1, 2]]]], "outputs": [[8]]}
user: You are given an array of unique numbers. The numbers represent points. The higher the number the higher the points.  
In the array [1,3,2] 3 is the highest point value so it gets 1st place. 2 is the second highest so it gets second place. 1 is the 3rd highest so it gets 3rd place. 

Your task is to return an array giving each number its rank in the array.  
input // [1,3,2] 
output // [3,1,2]

```rankings([1,2,3,4,5]) // [5,4,3,2,1]``` 
```rankings([3,4,1,2,5])//  [3,2,5,4,1]``` 
```rankings([10,20,40,50,30]) //  [5, 4, 2, 1, 3]``` 
```rankings([1, 10]) //   [2, 1]``` 
```rankings([22, 33, 18, 9, 110, 4, 1, 88, 6, 50]) //```
```[5, 4, 6, 7, 1, 9, 10, 2, 8, 3]```

Answer: {"fn_name": "rankings", "inputs": [[[1, 3, 2]], [[1, 2, 3, 4, 5]], [[3, 4, 1, 2, 5]], [[10, 20, 40, 50, 30]], [[1, 10]], [[22, 33, 18, 9, 110, 4, 1, 88, 6, 50]]], "outputs": [[[3, 1, 2]], [[5, 4, 3, 2, 1]], [[3, 2, 5, 4, 1]], [[5, 4, 2, 1, 3]], [[2, 1]], [[5, 4, 6, 7, 1, 9, 10, 2, 8, 3]]]}
user: Simple, given a string of words, return the length of the shortest word(s).

String will never be empty and you do not need to account for different data types.

Answer: {"fn_name": "find_short", "inputs": [["bitcoin take over the world maybe who knows perhaps"], ["turns out random test cases are easier than writing out basic ones"], ["lets talk about javascript the best language"], ["i want to travel the world writing code one day"], ["Lets all go on holiday somewhere very cold"]], "outputs": [[3], [3], [3], [1], [2]]}
user: # Letterss of Natac
In a game I just made up that doesn’t have anything to do with any other game that you may or may not have played, you collect resources on each turn and then use those resources to build things like roads, settlements and cities. If you would like to try other kata about this game, they can be found **[here](https://www.codewars.com/collections/59e6938afc3c49005900011f)**

## Task

This kata asks you to implement a time efficient version of the function `play_if_enough(hand, play)` , which takes as input a `hand`, the resources you have (a string of letters representing the resources you have), and a `play`, (a string of letters representing the resources required to build a certain game object), and returns a tuple (list in r) of a boolean value, corresponding to whether you have enough resources, and your hand. If you had enough to build the object, the returned hand is your resources minus those you used to build the object. If not, it is your original hand (the one passed to the function).  

For example, if it takes 3 ore and 2 grain to build a city, `play` is `”ooogg”`. If `hand` is `”ooooogggssbbb”`, then `play_if_enough(hand, play)` returns `(True, “oogssbbb”)`. 

## Examples
```python
play_if_enough("ooooogggssbbb", "ooogg")  => (True, "oogssbbb")
play_if_enough("oogssbbb", "bwsg")        => (False, "oogssbbb")
play_if_enough("", "bw")                  => (False, "")
play_if_enough("abcdefghij", "aa")        => (False, "abcdefghij")

```
## Notes: 
1. The order of resources in your hand (or play) is not relevant. You can shuffle your hand any way you'd like, so long as you have the same number of each resource.
2. There are 26 different resources, each represented by a lower case letter a-z, so a valid hand is a string of lower case letters.
3. A valid play is a string of any number of lower case letters.
4. You do not have to test for whether a hand or play is valid. 
5. A hand can be empty, but a play can't. In the event a hand is empty, you don't have the cards to play, so return `(False, "")`, in the correct data structure for your language, see example 4 above.
6. Tests include hand sizes of up to 150000 elements and play sizes up to 10000 elements.

Answer: {"fn_name": "play_if_enough", "inputs": [["", "bw"]], "outputs": [[[false, ""]]]}
user: # Do names have colors?

*Now they do.*

Make a function that takes in a name (Any string two chars or longer really, but the name is the idea) and use the ascii values of it's substrings to produce the hex value of its color! Here is how it's going to work:

* The first two hexadecimal digits are the *SUM* of the value of characters (modulo 256).
* The second two are the *PRODUCT* of all the characters (again, modulo 256, which is one more than `FF` in hexadecimal).
* The last two are the *ABSOLUTE VALUE of the DIFFERENCE* between the first letter, and the sum of every other letter. (I think you get the idea with the modulo thing).

For example `"Jack"` returns `"79CAE5"`, which is... **baby blue!**
```
"Jack"  #  "J" = 74, "a" = 97, "c" = 99, "k" = 107

74 + 97 + 99 + 107 = 377                   -->  mod 256 = 121  -->  hex: 79
74 * 97 * 99 * 107 = 76036554              -->  mod 256 = 202  -->  hex: CA
74 - (97 + 99 + 107) = -229  --> abs: 229  -->  mod 256 = 229  -->  hex: E5
```

NOTE: The function should return `None/nil` when the input is less than two chars.

Answer: {"fn_name": "string_color", "inputs": [["A"], [""], ["John Doe"], ["CodeWars"]], "outputs": [[null], [null], ["C70033"], ["182892"]]}
user: Given a string of integers, count how many times that integer repeats itself, then return a string showing the count and the integer.


Example: `countMe('1123')` (`count_me` in Ruby)

- Here 1 comes twice so `` will be `"21"`
- then 2 comes once so `` will be `"12"`
- then 3 comes once so `` will be `"13"`

hence output string will be `"211213"`.


Similarly `countMe('211213')` will return `'1221121113'`
(1 time 2, 2 times 1, 1 time 2, 1 time 1, 1 time 3)


Return `""` for empty, nil or non numeric strings

Answer: {"fn_name": "count_me", "inputs": [["1123"], ["1"], ["11"], ["a"], ["a123"], ["21"], ["1211"], ["12322212223443"], [""], ["123a"]], "outputs": [["211213"], ["11"], ["21"], [""], [""], ["1211"], ["111221"], ["111213321132132413"], [""], [""]]}
user: # Scenario

**_Several people_** are standing in *a row divided into two teams*.  
The **_first person_** goes into **_team 1_**, **_the second_** goes into **_team 2_**, **_the third_** goes into **_team 1_**, and so on.
___
# Task

**_Given_** *an array of positive integers (the weights of the people)*, **_return_** *a new array/tuple of two integers*, **_where_** **_the first_** one is the **_total weight of team 1_**, and **_the second_** one is the **_total weight of team 2_**.
___
# Notes 

* **_Array size_** is *at least 1*.
* **_All numbers_** will be **positive**.
___
# Input >> Output Examples 

```
rowWeights([13, 27, 49])  ==>  return (62, 27)
```

## **_Explanation_**:

**_The first element_** `62` is *the total weight of team 1*, and **_the second element_** `27` is *the total weight of team 2*.
___
```
rowWeights([50, 60, 70, 80])  ==>  return (120, 140)
```
## **_Explanation_**:

**_The first element_** `120` is *the total weight of team 1*, and **_the second element_** `140` is *the total weight of team 2*.
___
```
rowWeights([80])  ==>  return (80, 0)
```
## **_Explanation_**:

**_The first element_** `80` is *the total weight of team 1*, and **_the second element_** `0` is *the total weight of team 2*.
___
___
___

# [Playing with Numbers Series](https://www.codewars.com/collections/playing-with-numbers)

# [Playing With Lists/Arrays Series](https://www.codewars.com/collections/playing-with-lists-slash-arrays)

# [For More Enjoyable Katas](http://www.codewars.com/users/MrZizoScream/authored)
___

## ALL translations are welcomed

## Enjoy Learning !!
# Zizou

Answer: {"fn_name": "row_weights", "inputs": [[[80]], [[100, 50]], [[50, 60, 70, 80]], [[13, 27, 49]], [[70, 58, 75, 34, 91]], [[29, 83, 67, 53, 19, 28, 96]], [[0]], [[100, 51, 50, 100]], [[39, 84, 74, 18, 59, 72, 35, 61]], [[0, 1, 0]]], "outputs": [[[80, 0]], [[100, 50]], [[120, 140]], [[62, 27]], [[236, 92]], [[211, 164]], [[0, 0]], [[150, 151]], [[207, 235]], [[0, 1]]]}
user: # Task
You are a lifelong fan of your local football club, and proud to say you rarely miss a game. Even though you're a superfan, you still hate boring games. Luckily, boring games often end in a draw, at which point the winner is determined by a penalty shoot-out, which brings some excitement to the viewing experience. Once, in the middle of a penalty shoot-out, you decided to count the lowest total number of shots required to determine the winner. So, given the number of shots each team has already made and the current score, `how soon` can the game end?

If you are not familiar with penalty shoot-out rules, here they are:

`Teams take turns to kick from the penalty mark until each has taken five kicks. However, if one side has scored more successful kicks than the other could possibly reach with all of its remaining kicks, the shoot-out immediately ends regardless of the number of kicks remaining.`

`If at the end of these five rounds of kicks the teams have scored an equal number of successful kicks, additional rounds of one kick each will be used until the tie is broken.`



# Input/Output


`[input]` integer `shots`

An integer, the number of shots each team has made thus far.

`0 ≤ shots ≤ 100.`

`[input]` integer array `score`

An array of two integers, where score[0] is the current score of the first team and score[1] - of the second team.

`score.length = 2,`

`0 ≤ score[i] ≤ shots.`

`[output]` an integer

The minimal possible total number of shots required to determine the winner.


# Example

For `shots = 2 and score = [1, 2]`, the output should be `3`.

The possible 3 shots can be: 
```
shot1: the first team misses the penalty
shot2: the second team scores
shot3: the first one misses again```

then, score will be [1, 3]. As the first team can't get 2 more points in the last remaining shot until the end of the initial five rounds, the winner is determined.

For `shots = 10 and score = [10, 10]`, the output should be `2`.

If one of the teams misses the penalty and the other one scores, the game ends.

Answer: {"fn_name": "penaltyShots", "inputs": [[2, [1, 2]], [10, [10, 10]], [5, [5, 5]], [0, [0, 0]], [1, [0, 0]], [1, [0, 1]], [1, [1, 1]], [3, [3, 3]], [3, [1, 3]], [100, [100, 100]]], "outputs": [[3], [2], [2], [6], [5], [4], [5], [3], [1], [2]]}
user: The [Ones' Complement](https://en.wikipedia.org/wiki/Ones%27_complement) of a binary number is the number obtained by swapping all the 0s for 1s and all the 1s for 0s. For example:

```
onesComplement(1001) = 0110
onesComplement(1001) = 0110
```

For any given binary number,formatted as a string, return the Ones' Complement of that number.

Answer: {"fn_name": "ones_complement", "inputs": [["0"], ["1"], ["01"], ["10"], ["1101"]], "outputs": [["1"], ["0"], ["10"], ["01"], ["0010"]]}