meetforever/GRPO_CL huggingface dataset:
user: The sum of divisors of `6` is `12` and the sum of divisors of `28` is `56`. You will notice that `12/6 = 2` and `56/28 = 2`. We shall say that `(6,28)` is a pair with a ratio of `2`.  Similarly, `(30,140)` is also a pair but with a ratio of `2.4`. These ratios are simply decimal representations of fractions.

`(6,28)` and `(30,140)` are the only pairs in which `every member of a pair is 0 <= n < 200`. The sum of the lowest members of each pair is `6 + 30 = 36`. 

You will be given a `range(a,b)`, and your task is to group the numbers into pairs with the same ratios. You will return the sum of the lowest member of each pair in the range. If there are no pairs. return `nil` in Ruby, `0` in python. Upper limit is `2000`.

```Haskell
solve(0,200) = 36
```

Good luck!

if you like this Kata, please try:

[Simple division](https://www.codewars.com/kata/59ec2d112332430ce9000005)

[Sub-array division](https://www.codewars.com/kata/59eb64cba954273cd4000099)

Answer: {"fn_name": "solve", "inputs": [[1, 100], [1, 200], [1, 300], [200, 1000], [1, 1000], [100, 1000], [800, 2000]], "outputs": [[6], [36], [252], [1104], [2619], [2223], [2352]]}
user: Given an array of integers, find the one that appears an odd number of times.

There will always be only one integer that appears an odd number of times.

Answer: {"fn_name": "find_it", "inputs": [[[20, 1, -1, 2, -2, 3, 3, 5, 5, 1, 2, 4, 20, 4, -1, -2, 5]], [[1, 1, 2, -2, 5, 2, 4, 4, -1, -2, 5]], [[20, 1, 1, 2, 2, 3, 3, 5, 5, 4, 20, 4, 5]], [[10]], [[1, 1, 1, 1, 1, 1, 10, 1, 1, 1, 1]]], "outputs": [[5], [-1], [5], [10], [10]]}
user: Given two integers `a` and `b`, which can be positive or negative, find the sum of all the numbers between including them too and return it. If the two numbers are equal return `a` or `b`.

**Note:** `a` and `b` are not ordered!

## Examples

```python
get_sum(1, 0) == 1   // 1 + 0 = 1
get_sum(1, 2) == 3   // 1 + 2 = 3
get_sum(0, 1) == 1   // 0 + 1 = 1
get_sum(1, 1) == 1   // 1 Since both are same
get_sum(-1, 0) == -1 // -1 + 0 = -1
get_sum(-1, 2) == 2  // -1 + 0 + 1 + 2 = 2
```
```C
get_sum(1, 0) == 1   // 1 + 0 = 1
get_sum(1, 2) == 3   // 1 + 2 = 3
get_sum(0, 1) == 1   // 0 + 1 = 1
get_sum(1, 1) == 1   // 1 Since both are same
get_sum(-1, 0) == -1 // -1 + 0 = -1
get_sum(-1, 2) == 2  // -1 + 0 + 1 + 2 = 2
```

Answer: {"fn_name": "get_sum", "inputs": [[0, 1], [1, 2], [5, -1], [505, 4], [321, 123], [0, -1], [-50, 0], [-1, -5], [-5, -5], [-505, 4], [-321, 123], [0, 0], [-5, -1], [5, 1], [-17, -17], [17, 17]], "outputs": [[1], [3], [14], [127759], [44178], [-1], [-1275], [-15], [-5], [-127755], [-44055], [0], [-15], [15], [-17], [17]]}
user: The first positive integer, `n`, with its value `4n² + 1`, being divisible by `5` and `13` is `4`. (condition 1)

It can be demonstrated that we have infinite numbers that may satisfy the above condition.

If we name **ai**, the different terms of the sequence of numbers with this property, we define `S(n)` as:



We are interested in working with numbers of this sequence from 10 to 15 digits. Could you elaborate a solution for these results?

You will be given an integer value `m`(always valid an positive) and you should output the closest value of the sequence to `m`.

If the given value `m` is in the sequence, your solution should return the same value.

In the case that there are two possible solutions: `s1` and `s2`, (`s1 < s2`), because `|m - s1| = |m - s2|`, output the highest solution `s2`

No hardcoded solutions are allowed.

No misterious formulae are required, just good observation to discover hidden patterns.

See the example tests to see output format and useful examples, edge cases are included.

Features of the random tests
`1000 <= m <= 5.2 e14`

**Note** Sierpinsky presented the numbers that satisfy condition (1)

Answer: {"fn_name": "find_closest_value", "inputs": [[1], [5000], [7500], [8300], [14313], [20005], [18331], [18332]], "outputs": [[4], [5074], [7293], [8320], [14313], [20293], [17944], [18720]]}
user: Given two numbers (m and n) :

- convert all numbers from m to n to binary
- sum them as if they were in base 10 
- convert the result to binary
- return as string

Eg: with the numbers 1 and 4


   1 // 1 to binary is 1
+ 10 // 2 to binary is 10
+ 11 // 3 to binary is 11
+100 // 4 to binary is 100
----
 122 // 122 in Base 10 to Binary is 1111010



So BinaryPyramid ( 1 , 4 ) should return "1111010" 

range should be ascending in order

Answer: {"fn_name": "binary_pyramid", "inputs": [[1, 4], [1, 6], [6, 20], [21, 60], [100, 100], [1, 1], [0, 1], [0, 0], [1, 100], [100, 1000]], "outputs": [["1111010"], ["101001101"], ["1110010110100011"], ["1100000100010001010100"], ["100001100100101000100"], ["1"], ["1"], ["0"], ["10011101010010110000101010"], ["111111001111110110011011000101110101110"]]}
user: Given an array (a list in Python) of integers and an integer `n`, find all occurrences of `n` in the given array and return another array containing all the index positions of `n` in the given array.

If `n` is not in the given array, return an empty array `[]`.

Assume that `n` and all values in the given array will always be integers.

Example:
```python
find_all([6, 9, 3, 4, 3, 82, 11], 3)
> [2, 4]
```

Answer: {"fn_name": "find_all", "inputs": [[[6, 9, 3, 4, 3, 82, 11], 3], [[6, 9, 3, 4, 3, 82, 11], 99], [[10, 16, 20, 6, 14, 11, 20, 2, 17, 16, 14], 16], [[20, 20, 10, 13, 15, 2, 7, 2, 20, 3, 18, 2, 3, 2, 16, 10, 9, 9, 7, 5, 15, 5], 20]], "outputs": [[[2, 4]], [[]], [[1, 9]], [[0, 1, 8]]]}
user: Task:
Given an array arr of strings complete the function landPerimeter by calculating the total perimeter of all the islands. Each piece of land will be marked with 'X' while the water fields are represented as 'O'. Consider each tile being a perfect 1 x 1piece of land. Some examples for better visualization:

['XOOXO',
  'XOOXO',
  'OOOXO',
  'XXOXO',
  'OXOOO'] 

or 


should return:
"Total land perimeter: 24",

while


['XOOO',
  'XOXO',
  'XOXO',
  'OOXX',
  'OOOO']



should return: "Total land perimeter: 18"
Good luck!

Answer: {"fn_name": "land_perimeter", "inputs": [[["OXOOOX", "OXOXOO", "XXOOOX", "OXXXOO", "OOXOOX", "OXOOOO", "OOXOOX", "OOXOOO", "OXOOOO", "OXOOXX"]], [["OXOOO", "OOXXX", "OXXOO", "XOOOO", "XOOOO", "XXXOO", "XOXOO", "OOOXO", "OXOOX", "XOOOO", "OOOXO"]], [["XXXXXOOO", "OOXOOOOO", "OOOOOOXO", "XXXOOOXO", "OXOXXOOX"]], [["XOOOXOO", "OXOOOOO", "XOXOXOO", "OXOXXOO", "OOOOOXX", "OOOXOXX", "XXXXOXO"]], [["OOOOXO", "XOXOOX", "XXOXOX", "XOXOOO", "OOOOOO", "OOOXOO", "OOXXOO"]], [["X"]]], "outputs": [["Total land perimeter: 60"], ["Total land perimeter: 52"], ["Total land perimeter: 40"], ["Total land perimeter: 54"], ["Total land perimeter: 40"], ["Total land perimeter: 4"]]}
user: ### Task

Yes, your eyes are no problem, this is toLoverCase (), not toLowerCase (), we want to make the world full of love.
    
### What do we need to do?
    
You need to add a prototype function to the String, the name is toLoverCase. Function can convert the letters in the string, converted to "L", "O", "V", "E", if not the letter, don't change it.
    
### How to convert? :

```
"love!".toLoverCase()="EVOL!"
```

more example see the testcases.
    
### Series:
 - [Bug in Apple](http://www.codewars.com/kata/56fe97b3cc08ca00e4000dc9)
 - [Father and Son](http://www.codewars.com/kata/56fe9a0c11086cd842000008)
 - [Jumping Dutch act](http://www.codewars.com/kata/570bcd9715944a2c8e000009)
 - [Planting Trees](http://www.codewars.com/kata/5710443187a36a9cee0005a1)
 - [Give me the equation](http://www.codewars.com/kata/56fe9b65cc08cafbc5000de3)
 - [Find the murderer](http://www.codewars.com/kata/570f3fc5b29c702c5500043e)
 - [Reading a Book](http://www.codewars.com/kata/570ca6a520c69f39dd0016d4)
 - [Eat watermelon](http://www.codewars.com/kata/570df12ce6e9282a7d000947)
 - [Special factor](http://www.codewars.com/kata/570e5d0b93214b1a950015b1)
 - [Guess the Hat](http://www.codewars.com/kata/570ef7a834e61306da00035b)
 - [Symmetric Sort](http://www.codewars.com/kata/5705aeb041e5befba20010ba)
 - [Are they symmetrical?](http://www.codewars.com/kata/5705cc3161944b10fd0004ba)
 - [Max Value](http://www.codewars.com/kata/570771871df89cf59b000742)
 - [Trypophobia](http://www.codewars.com/kata/56fe9ffbc25bf33fff000f7c)
 - [Virus in Apple](http://www.codewars.com/kata/5700af83d1acef83fd000048)
 - [Balance Attraction](http://www.codewars.com/kata/57033601e55d30d3e0000633)
 - [Remove screws I](http://www.codewars.com/kata/5710a50d336aed828100055a)
 - [Remove screws II](http://www.codewars.com/kata/5710a8fd336aed00d9000594)
 - [Regular expression compression](http://www.codewars.com/kata/570bae4b0237999e940016e9)
 - [Collatz Array(Split or merge)](http://www.codewars.com/kata/56fe9d579b7bb6b027000001)
 - [Tidy up the room](http://www.codewars.com/kata/5703ace6e55d30d3e0001029)
 - [Waiting for a Bus](http://www.codewars.com/kata/57070eff924f343280000015)

Answer: {"fn_name": "to_lover_case", "inputs": [["LOVE"], ["love"], ["abcd"], ["ebcd"], ["Hello World!"], ["jrvz,"]], "outputs": [["EVOL"], ["EVOL"], ["LOVE"], ["LOVE"], ["ELEEV VVOEE!"], ["OOOO,"]]}
user: Write
```python
word_pattern(pattern, string)
```
that given a ```pattern``` and a string ```str```, find if ```str``` follows the same sequence as ```pattern```. 

For example:
```python
word_pattern('abab', 'truck car truck car') == True
word_pattern('aaaa', 'dog dog dog dog') == True
word_pattern('abab', 'apple banana banana apple') == False
word_pattern('aaaa', 'cat cat dog cat') == False
```

Answer: {"fn_name": "word_pattern", "inputs": [["abab", "apple banana apple banana"], ["abba", "car truck truck car"], ["abab", "apple banana banana apple"], ["aaaa", "cat cat cat cat"], ["aaaa", "cat cat dog cat"], ["bbbabcb", "c# c# c# javascript c# python c#"], ["abcdef", "apple banana cat donkey elephant flower"], ["xyzzyx", "apple banana apple banana"], ["xyzzyx", "1 2 3 3 2 1"], ["aafggiilp", "cow cow fly pig pig sheep sheep chicken aardvark"], ["aafggiilp", "cow cow fly rooster pig sheep sheep chicken aardvark"], ["aaaa", "cat cat cat"], ["abba", "dog dog dog dog"]], "outputs": [[true], [true], [false], [true], [false], [true], [true], [false], [true], [true], [false], [false], [false]]}
user: Wilson primes satisfy the following condition.
Let ```P``` represent a prime number. 

Then ```((P-1)! + 1) / (P * P)``` should give a whole number.

Your task is to create a function that returns ```true``` if the given number is a Wilson prime.

Answer: {"fn_name": "am_i_wilson", "inputs": [[0], [1], [5], [8], [9], [11], [13], [101], [563], [569]], "outputs": [[false], [false], [true], [false], [false], [false], [true], [false], [true], [false]]}
user: You're a programmer in a SEO company. The SEO specialist of your company gets the list of all project keywords everyday, then he looks for the longest keys to analyze them.

You will get the list with keywords and must write a simple function that returns the biggest search keywords and sorts them in lexicographical order.

For instance you might get:
```python
'key1', 'key2', 'key3', 'key n', 'bigkey2', 'bigkey1'
```

And your function should return:
```python
"'bigkey1', 'bigkey2'"
```

Don't forget to rate this kata! Thanks :)

Answer: {"fn_name": "the_biggest_search_keys", "inputs": [["key1", "key22", "key333"], ["coding", "sorting", "tryruby"], ["small keyword", "how to coding?", "very nice kata", "a lot of keys", "I like Ruby!!!"], ["pippi"]], "outputs": [["'key333'"], ["'sorting', 'tryruby'"], ["'I like Ruby!!!', 'how to coding?', 'very nice kata'"], ["'pippi'"]]}
user: # Task
Given an initial string `s`, switch case of the minimal possible number of letters to make the whole string written in the upper case or in the lower case.

# Input/Output


`[input]` string `s`

String of odd length consisting of English letters.

3 ≤ inputString.length ≤ 99.

`[output]` a string

The resulting string.

# Example

For `s = "Aba"`, the output should be `"aba"`

For `s = "ABa"`, the output should be `"ABA"`

Answer: {"fn_name": "case_unification", "inputs": [["asdERvT"], ["oyTYbWQ"], ["bbiIRvbcW"], ["rWTmvcoRWEWQQWR"]], "outputs": [["asdervt"], ["OYTYBWQ"], ["bbiirvbcw"], ["RWTMVCORWEWQQWR"]]}
user: As part of this Kata, you need to find the length of the sequence in an array, between the first and the second occurrence of a specified number.

For example, for a given array `arr`

    [0, -3, 7, 4, 0, 3, 7, 9]
    
Finding length between two `7`s like
    
    lengthOfSequence([0, -3, 7, 4, 0, 3, 7, 9], 7)
    
would return `5`.

For sake of simplicity, there will only be numbers (positive or negative) in the supplied array.

If there are less or more than two occurrences of the number to search for, return `0`, or in Haskell, `Nothing`.

Answer: {"fn_name": "length_of_sequence", "inputs": [[[1], 0], [[1], 1], [[-7, 3, -7, -7, 2, 1], -7], [[-7, 3, -7, -7, 2, -7], -7]], "outputs": [[0], [0], [0], [0]]}
user: # Task
 We have a N×N `matrix` (N<10) and a robot. 
 
 We wrote in each point of matrix x and y coordinates of a point of matrix. 
 
 When robot goes to a point of matrix, reads x and y and transfer to point with x and y coordinates.
 
 For each point in the matrix we want to know if robot returns back to it after `EXACTLY k` moves. So your task is to count points to which Robot returns in `EXACTLY k` moves. 
 
 You should stop counting moves as soon as the robot returns to the starting point. That is, if the robot returns to the starting point in fewer than k moves, that point should not count as a valid point.
 
# example

 For:
 ```
 matrix=[
 ["0,1","0,0","1,2"], 
 ["1,1","1,0","0,2"], 
 ["2,1","2,0","0,0"]]
 k= 2
 ```
 The result should be `8`
```
Robot start at (0,0) --> (0,1) --> (0,0), total 2 moves
Robot start at (0,1) --> (0,0) --> (0,1), total 2 moves
Robot start at (0,2) --> (1,2) --> (0,2), total 2 moves
Robot start at (1,2) --> (0,2) --> (1,2), total 2 moves
Robot start at (1,0) --> (1,1) --> (1,0), total 2 moves
Robot start at (1,1) --> (1,0) --> (1,1), total 2 moves
Robot start at (2,0) --> (2,1) --> (2,0), total 2 moves
Robot start at (2,1) --> (2,0) --> (2,1), total 2 moves
Robot start at (2,2) --> (0,0) --> (0,1) --> (0,0) --> (0,1) ....
(Robot can not transfer back to 2,2)
```
So the result is 8.

# Input/Output


 - `[input]` 2D integer array matrix
 
 n x n matrix. 3 <= n <=9
 
 
 - `[input]` integer `k`
 
 `2 <= k <= 5`
 
 
 - `[output]` an integer

Answer: {"fn_name": "robot_transfer", "inputs": [[[["0,1", "0,0", "1,2"], ["1,1", "1,0", "0,2"], ["2,1", "2,0", "0,0"]], 2], [[["0,1", "0,0"], ["1,1", "1,0"]], 2]], "outputs": [[8], [4]]}
user: You will be given a certain array of length ```n```, such that ```n > 4```, having positive and negative integers but there will be no zeroes and all the elements will occur once in it.

We may obtain an amount of ```n``` sub-arrays of length ```n - 1```, removing one element at a time (from left to right). 

For each subarray, let's calculate the product and sum of its elements with the corresponding absolute value of the quotient, ```q = SubProduct/SubSum``` (if it is possible, SubSum cannot be 0). 
Then we select the array with the lowest value of ```|q|```(absolute value)

e.g.: we have the array, ```arr = [1, 23, 2, -8, 5]```
```
Sub Arrays            SubSum    SubProduct         |q|
[23, 2, -8, 5]         22         -1840         83.636363
[1, 2, -8, 5]           0           -80          No value
[1, 23, -8, 5]         21          -920         43.809524
[1, 23, 2, 5]          31           230          7.419355  <--- selected array
[1, 23, 2, -8]         18           368         20.444444
```
Let's compare the given array with the selected subarray:
```
[1, 23, 2, -8, 5]
[1, 23, 2,     5]
```
The difference between them is at the index ```3``` for the given array, with element ```-8```, so we put both things for a result ```[3, -8]```.

That means that to obtain the selected subarray we have to take out the value -8 at index 3.
We need a function that receives an array as an argument and outputs the the pair ```[index, arr[index]]``` that generates the subarray with  the lowest value of ```|q|```.

```python 
select_subarray([1, 23, 2, -8, 5]) == [3, -8]
```
Another case:
```python 
select_subarray([1, 3, 23, 4, 2, -8, 5, 18]) == [2, 23]
```
In Javascript the function will be ```selectSubarray()```.

We may have some special arrays that may have more than one solution as the one that follows below.
```python 
select_subarray([10, 20, -30, 100, 200]) == [[3, 100], [4, 200]]
```
If there is more than one result the function should output a 2Darray sorted by the index of the element removed from the array.

Thanks to Unnamed for detecting the special cases when we have multiple solutions.

Features of the random tests:
```
Number of tests = 200
length of the array, l, such that 20 <= l <= 100
```

Enjoy it!!

Answer: {"fn_name": "select_subarray", "inputs": [[[1, 23, 2, -8, 5]], [[1, 3, 23, 4, 2, -8, 5, 18]], [[2, -8, 5, 18]], [[10, 20, -30, 100, 200]]], "outputs": [[[3, -8]], [[2, 23]], [[1, -8]], [[[3, 100], [4, 200]]]]}
user: In genetics a reading frame is a way to divide a sequence of nucleotides (DNA bases) into a set of consecutive non-overlapping triplets (also called codon). Each of this triplets is translated into an amino-acid during a translation process to create proteins.

Input
---
In a single strand of DNA you find 3 Reading frames, take for example the following input sequence:

    AGGTGACACCGCAAGCCTTATATTAGC
    
Output
---
For the output we are going to take the combinations and show them in the following manner:

````
Frame 1: AGG TGA CAC CGC AAG CCT TAT ATT AGC
Frame 2: A GGT GAC ACC GCA AGC CTT ATA TTA GC
Frame 3: AG GTG ACA CCG CAA GCC TTA TAT TAG C
````

For frame 1 split all of them in groups of three starting by the first base (letter).

For frame 2 split all of them in groups of three starting by the second base (letter) but having the first base (letter) at the beggining.

For frame 3 split all of them in groups of three starting by the third letter, but having the first and second bases (letters) at the beginning in the same order.

Series
---

1. [Decompose single strand DNA into 3 reading frames](http://www.codewars.com/kata/57507369b0b6d1b5a60001b3)

2. [Decompose double strand DNA into 6 reading frames](http://www.codewars.com/kata/57519060f2dac7ec95000c8e/)

3.  [Translate DNA to protein in 6 frames](http://www.codewars.com/kata/5708ef48fe2d018413000776)

Answer: {"fn_name": "decompose_single_strand", "inputs": [["AGGTGACACCGCAAGCCTTATATTAGC"]], "outputs": [["Frame 1: AGG TGA CAC CGC AAG CCT TAT ATT AGC\nFrame 2: A GGT GAC ACC GCA AGC CTT ATA TTA GC\nFrame 3: AG GTG ACA CCG CAA GCC TTA TAT TAG C"]]}
user: ## MTV Cribs is back!

![](https://s-media-cache-ak0.pinimg.com/236x/1b/cf/f4/1bcff4f4621644461103576e40bde4ed.jpg)

_If you haven't solved it already I recommend trying [this kata](https://www.codewars.com/kata/5834a44e44ff289b5a000075) first._

## Task

Given `n` representing the number of floors build a penthouse like this:

```
        ___
       /___\                
      /_____\
      |  _  |     1 floor
      |_|_|_|
      
       _____
      /_____\
     /_______\
    /_________\             
   /___________\
   |           |
   |    ___    |     2 floors
   |   |   |   |
   |___|___|___|
 
      _______
     /_______\
    /_________\
   /___________\
  /_____________\
 /_______________\
/_________________\
|                 |         3 floors
|                 |
|      _____      |
|     |     |     |
|     |     |     |
|_____|_____|_____|

```

**Note:** whitespace should be preserved on both sides of the roof. No invalid input tests.

Good luck!

Answer: {"fn_name": "my_crib", "inputs": [[1], [2], [3]], "outputs": [["  ___  \n /___\\ \n/_____\\\n|  _  |\n|_|_|_|"], ["    _____    \n   /_____\\   \n  /_______\\  \n /_________\\ \n/___________\\\n|           |\n|    ___    |\n|   |   |   |\n|___|___|___|"], ["      _______      \n     /_______\\     \n    /_________\\    \n   /___________\\   \n  /_____________\\  \n /_______________\\ \n/_________________\\\n|                 |\n|                 |\n|      _____      |\n|     |     |     |\n|     |     |     |\n|_____|_____|_____|"]]}
user: ```if-not:sql
Create a function (or write a script in Shell) that takes an integer as an argument and returns "Even" for even numbers or "Odd" for odd numbers.
```

```if:sql
## SQL Notes:
You will be given a table, `numbers`, with one column `number`.

Return a table with a column `is_even` containing "Even" or "Odd" depending on `number` column values.

### numbers table schema
* number INT

### output table schema
* is_even STRING
```

Answer: {"fn_name": "even_or_odd", "inputs": [[2], [1], [0], [1545452], [7], [78], [17], [74156741], [100000], [-123], [-456]], "outputs": [["Even"], ["Odd"], ["Even"], ["Even"], ["Odd"], ["Even"], ["Odd"], ["Odd"], ["Even"], ["Odd"], ["Even"]]}
user: Hey CodeWarrior,

we've got a lot to code today!

I hope you know the basic string manipulation methods, because this kata will be all about them.

Here we go...

## Background

We've got a very long string, containing a bunch of User IDs. This string is a listing, which seperates each user ID with a comma and a whitespace ("' "). Sometimes there are more than only one whitespace. Keep this in mind! Futhermore, some user Ids are written only in lowercase, others are mixed lowercase and uppercase characters. Each user ID starts with the same 3 letter "uid", e.g. "uid345edj". But that's not all! Some stupid student edited the string and added some hashtags (#). User IDs containing hashtags are invalid, so these hashtags should be removed!

## Task

1.  Remove all hashtags
2.  Remove the leading "uid" from each user ID
3.  Return an array of strings --> split the string
4.  Each user ID should be written in only lowercase characters
5.  Remove leading and trailing whitespaces

---

## Note

Even if this kata can be solved by using Regex or Linq, please try to find a solution by using only C#'s string class.

Some references for C#:

- [Microsoft MDSN: Trim](https://msdn.microsoft.com/de-de/library/t97s7bs3%28v=vs.110%29.aspx)
- [Microsoft MSDN: Split](https://msdn.microsoft.com/de-de/library/tabh47cf%28v=vs.110%29.aspx)
- [Microsoft MSDN: ToLower](https://msdn.microsoft.com/en-us/library/system.string.tolower%28v=vs.110%29.aspx)
- [Microsoft MSDN: Replace](https://msdn.microsoft.com/de-de/library/fk49wtc1%28v=vs.110%29.aspx)
- [Microsoft MSDN: Substring](https://msdn.microsoft.com/de-de/library/aka44szs%28v=vs.110%29.aspx)

Answer: {"fn_name": "get_users_ids", "inputs": [["uid12345"], ["   uidabc  "], ["#uidswagger"], ["uidone, uidtwo"], ["uidCAPSLOCK"], ["uid##doublehashtag"], ["  uidin name whitespace"], ["uidMultipleuid"], ["uid12 ab, uid#, uidMiXeDcHaRs"], [" uidT#e#S#t# "]], "outputs": [[["12345"]], [["abc"]], [["swagger"]], [["one", "two"]], [["capslock"]], [["doublehashtag"]], [["in name whitespace"]], [["multipleuid"]], [["12 ab", "", "mixedchars"]], [["test"]]]}
user: # Task
 Four men, `a, b, c and d` are standing in a line, one behind another. 
 
 There's a wall between the first three people (a, b and c) and the last one (d).
 
 a, b and c are lined up in order of height, so that person a can see the backs of b and c, person b can see the back of c, and c can see just the wall.

 There are 4 hats, 2 black and 2 white. Each person is given a hat. None of them can see their own hat, but person a can see the hats of b and c, while person b can see the hat of person c. Neither c nor d can see any hats.

 Once a person figures out their hat's color, they shouts it. 
 
 ![](http://stuffbox.in/wp-content/uploads/2016/08/Guess-hat-colour-604x270.png)
 
 Your task is to return the person who will guess their hat first. You can assume that they will speak only when they reach a correct conclusion.

# Input/Output


 - `[input]` string `a`

  a's hat color ("white" or "black").


 - `[input]` string `b`

  b's hat color ("white" or "black").


 - `[input]` string `c`

  c's hat color ("white" or "black").


 - `[input]` string `d`

  d's hat color ("white" or "black").


 - `[output]` an integer

 The person to guess his hat's color first, `1 for a, 2 for b, 3 for c and 4 for d`.

Answer: {"fn_name": "guess_hat_color", "inputs": [["white", "black", "white", "black"], ["white", "black", "black", "white"]], "outputs": [[2], [1]]}