meetforever/GRPO_CL huggingface dataset:
user: An array is said to be `hollow` if it contains `3` or more `0`s in the middle that are preceded and followed by the same number of non-zero elements. Furthermore, all the zeroes in the array must be in the middle of the array. 

Write a function named `isHollow`/`is_hollow`/`IsHollow` that accepts an integer array and returns `true` if it is a hollow array,else `false`.

Answer: {"fn_name": "is_hollow", "inputs": [[[-1, 0, 0, 0, 3]], [[1, 0, 0, 0, 0]]], "outputs": [[true], [false]]}
user: A number is self-descriptive when the n'th digit describes the amount n appears in the number.

E.g. 21200:

There are two 0's in the number, so the first digit is 2.

There is one 1 in the number, so the second digit is 1.

There are two 2's in the number, so the third digit is 2.

There are no 3's in the number, so the fourth digit is 0.

There are no 4's in the number, so the fifth digit is 0


Numbers can be of any length up to 9 digits and are only full integers. For a given number derive a function ```selfDescriptive(num)``` that returns; ```true``` if the number is self-descriptive or ```false``` if the number is not.

Answer: {"fn_name": "self_descriptive", "inputs": [[21200], [3211000], [42101000], [21230], [11200], [1210], [51120111], [2020], [11201], [6210001000]], "outputs": [[true], [true], [true], [false], [false], [true], [false], [true], [false], [true]]}
user: Write a function, that doubles every second integer in a list starting from the left.

Answer: {"fn_name": "double_every_other", "inputs": [[[1, 2, 3, 4, 5]], [[1, 19, 6, 2, 12, -3]], [[-1000, 1653, 210, 0, 1]]], "outputs": [[[1, 4, 3, 8, 5]], [[1, 38, 6, 4, 12, -6]], [[-1000, 3306, 210, 0, 1]]]}
user: # Write Number in Expanded Form - Part 2

This is version 2 of my ['Write Number in Exanded Form' Kata](https://www.codewars.com/kata/write-number-in-expanded-form).

You will be given a number and you will need to return it as a string in [Expanded Form](https://www.mathplacementreview.com/arithmetic/decimals.php#writing-a-decimal-in-expanded-form). For example:

```python
expanded_form(1.24) # Should return '1 + 2/10 + 4/100'
expanded_form(7.304) # Should return '7 + 3/10 + 4/1000'
expanded_form(0.04) # Should return '4/100'
```

Answer: {"fn_name": "expanded_form", "inputs": [[1.24], [7.304], [0.04], [1.04], [7.3004], [0.004], [693.230459]], "outputs": [["1 + 2/10 + 4/100"], ["7 + 3/10 + 4/1000"], ["4/100"], ["1 + 4/100"], ["7 + 3/10 + 4/10000"], ["4/1000"], ["600 + 90 + 3 + 2/10 + 3/100 + 4/10000 + 5/100000 + 9/1000000"]]}
user: `This kata is the first of the ADFGX Ciphers, the harder version can be found `here.

The ADFGX Cipher is a pretty well-known Cryptographic tool, and is essentially a modified Polybius Square.

Rather than having numbers as coordinates on the table, it has the letters:

 `A, D, F, G, X`

Also, because this is the first step, and to help simplify things, you won't have to worry about a key, or the corresponding columnar transposition. In this kata ;)

All you have to do is encrypt and decrypt a string into `ADFGX` format.

`adfgx_encrypt() and adfgx_decrypt()` will be passed a string, `plaintext` and `ciphertext` respectively, and an adfgx`square`, for which will guide the operations. 

Now for some examples to clear confusion:

```python
adfgx_encrypt("helloworld", "bchigklnmoqprstuvwxyzadef")

    A D F G X
   
A   b c h i g
D   k l n m o     
F   q p r s t  -> square (PLEASE NOTE, j SHOULD BE TREATED AS i)  
G   u v w x y  
X   z a d e f

"helloworld"   -> plaintext

EVALUATES TO:

      F  
          -> "AF"
A     h
--------------
          G 
               -> "XG"  
X         e 

AND SO FORTH...

#Results in:

adfgx_encrypt("helloworld", "bchigklnmoqprstuvwxyzadef") 
==
"AFXGDDDDDXGFDXFFDDXF"
```
Now decryption:
```python
adfgx_decrypt("FGXGADGDXGFXAXXGFGFGAADGXG", "aczlmuqngoipvstkrwfxhdbey) 

    A D F G X

A   a c z l m
D   u q n g o     
F   i p v s t  -> square (PLEASE NOTE, j SHOULD BE TREATED AS i)  
G   k r w f x  
X   h d b e y

"FGXGADGDXGFXAXXGFGFGAADGXG"   -> ciphertext

"FG" == "s"
"XG" == "e"

AND SO ON:

adfgx_decrypt("FGXGADGDXGFXAXXGFGFGAADGXG", "aczlmuqngoipvstkrwfxhdbey) 
==
"secretmessage"
```
PLEASE NOTE: ALL INPUT WILL BE VALID, NO NEED TO ERROR CHECK :D

What are you waiting for?!
Go create `adfgx_encrypt() and adfgx_decrypt()`!

Good Luck!

Answer: {"fn_name": "adfgx_encrypt", "inputs": [["helloworld", "bchigklnmoqprstuvwxyzadef"]], "outputs": [["AFXGDDDDDXGFDXFFDDXF"]]}
user: In this Kata, you will be given a string and your task will be to return a list of ints detailing the count of uppercase letters, lowercase, numbers and special characters, as follows.

```Haskell
Solve("*'&ABCDabcde12345") = [4,5,5,3]. 
--the order is: uppercase letters, lowercase, numbers and special characters.
```

More examples in the test cases. 

Good luck!

Answer: {"fn_name": "solve", "inputs": [["Codewars@codewars123.com"], ["bgA5<1d-tOwUZTS8yQ"], ["P*K4%>mQUDaG$h=cx2?.Czt7!Zn16p@5H"], ["RYT'>s&gO-.CM9AKeH?,5317tWGpS<*x2ukXZD"], ["$Cnl)Sr<7bBW-&qLHI!mY41ODe"], ["@mw>0=QD-iAx!rp9TaG?o&M%l$34L.nbft"]], "outputs": [[[1, 18, 3, 2]], [[7, 6, 3, 2]], [[9, 9, 6, 9]], [[15, 8, 6, 9]], [[10, 7, 3, 6]], [[7, 13, 4, 10]]]}
user: You're a buyer/seller and your buisness is at stake... You ___need___ to make profit... Or at least, you need to lose the least amount of money!  
Knowing a list of prices for buy/sell operations, you need to pick two of them. Buy/sell market is evolving across time and the list represent this evolution. First, you need to buy one item, then sell it later. Find the best profit you can do.

### Example:

Given an array of prices `[3, 10, 8, 4]`, the best profit you could make would be `7` because you buy at `3` first, then sell at `10`.

# Input:

A list of prices (integers), of length 2 or more.

# Output:

The result of the best buy/sell operation, as an integer.



### Note:
Be aware you'll face lists with several thousands of elements, so think about performance.

Answer: {"fn_name": "max_profit", "inputs": [[[10, 7, 5, 8, 11, 9]], [[3, 4]], [[9, 9]], [[10, 7, 5, 4, 1]]], "outputs": [[6], [1], [0], [-1]]}
user: Every Turkish citizen has an identity number whose validity can be checked by these set of rules:

- It is an 11 digit number
- First digit can't be zero
- Take the sum of 1st, 3rd, 5th, 7th and 9th digit and multiply it by 7.
Then subtract the sum of 2nd, 4th, 6th and 8th digits from this value.
Modulus 10 of the result should be equal to 10th digit.
- Sum of first ten digits' modulus 10 should be equal to eleventh digit.

Example:

    10167994524
    //  1+1+7+9+5= 23   // "Take the sum of 1st, 3rd, 5th, 7th and 9th digit..."
    //    23 * 7= 161   //  "...and multiply it by 7"
    //   0+6+9+4 = 19   // "Take the sum of 2nd, 4th, 6th and 8th digits..."
    // 161 - 19 = 142   // "...and subtract from first value"
    // "Modulus 10 of the result should be equal to 10th digit"
    10167994524
             ^ = 2 = 142 % 10
    // 1+0+1+6+7+9+9+4+5+2 = 44
    // "Sum of first ten digits' modulus 10 should be equal to eleventh digit"
    10167994524
              ^ = 4 = 44 % 10

Your task is to write a function to check the validity of a given number.
Return `true` or `false` accordingly.

Note: The input can be a string in some cases.

Answer: {"fn_name": "check_valid_tr_number", "inputs": [[6923522112], [692352217312], ["x5810a78432"], [36637640050], [12762438338], ["03868894286"], [10000000146], [19415235426], [16691067984], [72097107542], [57040492705]], "outputs": [[false], [false], [false], [true], [false], [false], [true], [true], [false], [true], [false]]}
user: # Feynman's squares
Richard Phillips Feynman was a well-known American physicist and a recipient of the Nobel Prize in Physics. He worked in theoretical physics and pioneered the field of quantum computing.

Recently, an old farmer found some papers and notes that are believed to have belonged to Feynman. Among notes about mesons and electromagnetism, there was a napkin where he wrote a simple puzzle: "how many different squares are there in a grid of NxN squares?".

For example, when N=2, the answer is 5: the 2x2 square itself, plus the four 1x1 squares in its corners:



# Task

You have to write a function

```python
def count_squares(n):
```

that solves Feynman's question in general. The input to your function will always be a positive integer.

#Examples

```python
count_squares(1) =  1
count_squares(2) =  5
count_squares(3) = 14
```

(Adapted from the Sphere Online Judge problem SAMER08F by Diego Satoba)

Answer: {"fn_name": "count_squares", "inputs": [[1], [2], [3], [5], [8], [15]], "outputs": [[1], [5], [14], [55], [204], [1240]]}
user: # Task
 John loves encryption. He can encrypt any string by the following algorithm:
```
take the first and the last letters of the word;
replace the letters between them with their number;
replace this number with the sum of it digits 
          until a single digit is obtained.```
Given two strings(`s1` and `s2`), return `true` if their encryption is the same, or `false` otherwise.

# Example

 For `s1 = "EbnhGfjklmjhgz" and s2 = "Eabcz"`, the result should be `true`.
 ```
 "EbnhGfjklmjhgz" --> "E12z" --> "E3z"
 "Eabcz" --> "E3z"
 Their encryption is the same.```
 
# Input/Output


 - `[input]` string `s1`

  The first string to be encrypted.
  
  `s1.length >= 3`
 
 
 - `[input]` string `s2`

  The second string to be encrypted.

  `s2.length >= 3`
  
  
 - `[output]` a boolean value

 `true` if encryption is the same, `false` otherwise.

Answer: {"fn_name": "same_encryption", "inputs": [["abc", "abc"], ["abc", "abd"], ["fKhjuytrdfcdc", "flJc"], ["OKhjuytrdfcdc", "OijK"]], "outputs": [[true], [false], [true], [false]]}
user: Given three arrays of integers, return the sum of elements that are common in all three arrays.

For example: 

```
common([1,2,3],[5,3,2],[7,3,2]) = 5 because 2 & 3 are common in all 3 arrays
common([1,2,2,3],[5,3,2,2],[7,3,2,2]) = 7 because 2,2 & 3 are common in the 3 arrays
```

More examples in the test cases. 

Good luck!

Answer: {"fn_name": "common", "inputs": [[[1, 2, 3], [5, 3, 2], [7, 3, 2]], [[1, 2, 2, 3], [5, 3, 2, 2], [7, 3, 2, 2]], [[1], [1], [1]], [[1], [1], [2]]], "outputs": [[5], [7], [1], [0]]}
user: Write a function with the signature shown below:
```python
def is_int_array(arr):
    return True
```
* returns `true  / True`  if every element in an array is an integer or a float with no decimals.
* returns `true  / True`  if array is empty.
* returns `false / False` for every other input.

Answer: {"fn_name": "is_int_array", "inputs": [[[]], [[1, 2, 3, 4]], [[-11, -12, -13, -14]], [[1.0, 2.0, 3.0]], [[1, 2, null]], [null], [""], [[null]], [[1.0, 2.0, 3.0001]], [["-1"]]], "outputs": [[true], [true], [true], [true], [false], [false], [false], [false], [false], [false]]}
user: Imagine two rings with numbers on them. The inner ring spins clockwise (decreasing by 1 each spin) and the outer ring spins counter clockwise (increasing by 1 each spin). We start with both rings aligned on 0 at the top, and on each move we spin each ring one increment. How many moves will it take before both rings show the same number at the top again?

The inner ring has integers from 0 to innerMax and the outer ring has integers from 0 to outerMax, where innerMax and outerMax are integers >= 1.

```
e.g. if innerMax is 2 and outerMax is 3 then after
1 move: inner = 2, outer = 1
2 moves: inner = 1, outer = 2
3 moves: inner = 0, outer = 3
4 moves: inner = 2, outer = 0
5 moves: inner = 1, outer = 1
Therefore it takes 5 moves for the two rings to reach the same number
Therefore spinningRings(2, 3) = 5
```
```
e.g. if innerMax is 3 and outerMax is 2 then after
1 move: inner = 3, outer = 1
2 moves: inner = 2, outer = 2
Therefore it takes 2 moves for the two rings to reach the same number
spinningRings(3, 2) = 2
```

---

for a bigger challenge, check out the [Performance Version](https://www.codewars.com/kata/59b0b7cd2a00d219ab0000c5) of this kata by @Voile

Answer: {"fn_name": "spinning_rings", "inputs": [[2, 3], [3, 2], [1, 1], [2, 2], [3, 3]], "outputs": [[5], [2], [1], [3], [2]]}
user: In this Kata, you will be given a multi-dimensional array containing `2 or more` sub-arrays of integers. Your task is to find the maximum product that can be formed by taking any one element from each sub-array.

```
Examples:
solve( [[1, 2],[3, 4]] ) = 8. The max product is given by 2 * 4
solve( [[10,-15],[-1,-3]] ) = 45, given by (-15) * (-3)
solve( [[1,-1],[2,3],[10,-100]] ) = 300, given by (-1) * 3 * (-100)
```

More examples in test cases. Good luck!

Answer: {"fn_name": "solve", "inputs": [[[[1, 2], [3, 4]]], [[[10, -15], [-1, -3]]], [[[-1, 2, -3, 4], [1, -2, 3, -4]]], [[[-11, -6], [-20, -20], [18, -4], [-20, 1]]], [[[14, 2], [0, -16], [-12, -16]]], [[[-3, -4], [1, 2, -3]]], [[[-2, -15, -12, -8, -16], [-4, -15, -7], [-10, -5]]]], "outputs": [[8], [45], [12], [17600], [3584], [12], [-40]]}
user: Mr Leicester's cheese factory is the pride of the East Midlands, but he's feeling a little blue. It's the time of the year when **the taxman is coming round to take a slice of his cheddar** - and the final thing he has to work out is how much money he's spending on his staff. Poor Mr Leicester can barely sleep he's so stressed. Can you help? 

- Mr Leicester **employs 4 staff**, who together make **10 wheels of cheese every 6 minutes**.
- Worker pay is calculated on **how many wheels of cheese they produce in a day**. 
- Mr Leicester pays his staff according to the UK living wage, which is currently **£8.75p an hour**. There are **100 pence (p) to the UK pound (£)**. 

The input for function payCheese will be provided as an array of five integers, one for each amount of cheese wheels produced each day.

When the workforce don't work a nice integer number of minutes - much to the chagrin of the company accountant - Mr Leicester very generously **rounds up to the nearest hour** at the end of the week (*not the end of each day*). Which means if the workers make 574 wheels on each day of the week, they're each paid 29 hours for the week (28.699 hours rounded up) and not 30 (6 hours a day rounded up * 5).

The return value should be a string (with the £ included) of the **total £ of staff wages for that week.**

Answer: {"fn_name": "pay_cheese", "inputs": [[[750, 750, 750, 750, 600]], [[700, 750, 700, 750, 600]], [[574, 574, 574, 574, 574]], [[1, 1, 1, 1, 1]], [[0, 0, 0, 0, 0]]], "outputs": [["L1260"], ["L1225"], ["L1015"], ["L35"], ["L0"]]}
user: # Task
 Given an integer `product`, find the smallest positive integer the product of whose digits is equal to product. If there is no such integer, return -1 instead.

# Example

 For `product = 1`, the output should be `11`;
 
 `1 x 1 = 1` (1 is not a valid result, because it has only 1 digit)
 
 For `product = 12`, the output should be `26`;
 
 `2 x 6 = 12`
 
 For `product = 19`, the output should be `-1`.
 
 No valid result found.
 
 For `product = 450`, the output should be `2559`.
 
 `2 x 5 x 5 x 9 = 450`
 
 For `product = 581`, the output should be `-1`.
 
 No valid result found. 
 
 Someone says the output should be `783`, because `7 x 83 = 581`.
 
 Please note: `83` is not a **DIGIT**.
 
# Input/Output


 - `[input]` integer `product`

    Constraints: `0 ≤ product ≤ 600`.


 - `[output]` a positive integer

Answer: {"fn_name": "digits_product", "inputs": [[12], [19], [450], [0], [13], [1], [5], [10]], "outputs": [[26], [-1], [2559], [10], [-1], [11], [15], [25]]}
user: The medians of a triangle are the segments that unit the vertices with the midpoint of their opposite sides.
The three medians of a triangle intersect at the same point, called the barycenter or the centroid.
Given a triangle, defined by the cartesian coordinates of its vertices we need to localize its barycenter or centroid.

The function ```bar_triang() or barTriang or bar-triang```, receives the coordinates of the three vertices ```A, B and C ``` as three different arguments and outputs the coordinates of the barycenter ```O``` in an array ```[xO, yO]```

This is how our asked function should work:
the result of the coordinates should be expressed up to four decimals, (rounded result).

You know that the coordinates of the barycenter are given by the following formulas.



For additional information about this important point of a triangle see at: (https://en.wikipedia.org/wiki/Centroid)

Let's see some cases:
```python
bar_triang([4, 6], [12, 4], [10, 10]) ------> [8.6667, 6.6667]

bar_triang([4, 2], [12, 2], [6, 10] ------> [7.3333, 4.6667]
```
The given points form a real or a degenerate triangle but in each case the above formulas can be used.

Enjoy it and happy coding!!

Answer: {"fn_name": "bar_triang", "inputs": [[[4, 6], [12, 4], [10, 10]], [[4, 2], [12, 2], [6, 10]], [[4, 8], [8, 2], [16, 6]]], "outputs": [[[8.6667, 6.6667]], [[7.3333, 4.6667]], [[9.3333, 5.3333]]]}
user: In this kata you must take an input string, reverse the order of the words, and reverse the order of the letters within the words.

But, as a bonus, every test input will end with a punctuation mark (! ? .) and the output should be returned with the mark at the end.

A few examples should help clarify:

```python
esrever("hello world.") == "dlrow olleh."

esrever("Much l33t?") == "t33l hcuM?"

esrever("tacocat!") == "tacocat!"
```

Quick Note: A string will always be passed in (though it may be empty) so no need for error-checking other types.

Answer: {"fn_name": "esrever", "inputs": [["an Easy one?"], ["a small lOan OF 1,000,000 $!"], ["<?> &!.\"."], ["b3tTer p4ss thIS 0ne."], [""]], "outputs": [["eno ysaE na?"], ["$ 000,000,1 FO naOl llams a!"], ["\".!& >?<."], ["en0 SIht ss4p reTt3b."], [""]]}
user: This is the simple version of Fastest Code series. If you need some challenges, please try the [Performance version](http://www.codewars.com/kata/5714594d2817ff681c000783)

## Task: 
    
Give you a number array ```numbers``` and a number ```c```.

Find out a pair of numbers(we called them number a and number b) from the array ```numbers```, let a*b=c, result format is an array ```[a,b]```

The array ```numbers``` is a sorted array, value range: `-100...100`

The result will be the first pair of numbers, for example,```findAB([1,2,3,4,5,6],6)``` should return ```[1,6]```, instead of ```[2,3]```

Please see more example in 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": "find_a_b", "inputs": [[[1, 2, 3], 3], [[1, 2, 3], 6], [[1, 2, 3], 7], [[1, 2, 3, 6], 6], [[1, 2, 3, 4, 5, 6], 15], [[0, 0, 2], 4], [[0, 0, 2, 2], 4], [[-3, -2, -2, -1, 0, 1, 2, 3, 4], 4], [[-3, -2, -2, -1, 0, 1, 2, 3, 4], 0], [[-3, -2, -1, 0, 1, 2, 3, 4], 4]], "outputs": [[[1, 3]], [[2, 3]], [null], [[1, 6]], [[3, 5]], [null], [[2, 2]], [[-2, -2]], [[-3, 0]], [[1, 4]]]}
user: # Task
 You are given a decimal number `n` as a **string**. Transform it into an array of numbers (given as **strings** again), such that each number has only one nonzero digit and their sum equals n.

 Each number in the output array should be written without any leading and trailing zeros.

# Input/Output


 - `[input]` string `n`

 A non-negative number.
 
 `1 ≤ n.length ≤ 30.`


 - `[output]` a string array

  Elements in the array should be sorted in descending order.


# Example

 For `n = "7970521.5544"` the output should be:
 ```
 ["7000000", 
 "900000", 
 "70000", 
 "500", 
 "20", 
 "1", 
 ".5",
 ".05",
 ".004",
 ".0004"]
  ```
 For `n = "7496314"`, the output should be:
 ```
 ["7000000", 
 "400000", 
 "90000", 
 "6000", 
 "300", 
 "10", 
 "4"]
```

 For `n = "0"`, the output should be `[]`

Answer: {"fn_name": "split_exp", "inputs": [["7970521.5544"], ["7496314"], ["0"], ["6"], ["1.0000000000"], ["0000000000.1"], ["1010101"], ["1234567890.1234567890"]], "outputs": [[["7000000", "900000", "70000", "500", "20", "1", ".5", ".05", ".004", ".0004"]], [["7000000", "400000", "90000", "6000", "300", "10", "4"]], [[]], [["6"]], [["1"]], [[".1"]], [["1000000", "10000", "100", "1"]], [["1000000000", "200000000", "30000000", "4000000", "500000", "60000", "7000", "800", "90", ".1", ".02", ".003", ".0004", ".00005", ".000006", ".0000007", ".00000008", ".000000009"]]]}
user: In this kata, your task is to write a function `to_bytes(n)` (or `toBytes(n)` depending on language) that produces a list of bytes that represent a given non-negative integer `n`. Each byte in the list is represented by a string of `'0'` and `'1'` of length 8. The most significant byte is first in the list. The example test cases should provide you with all the details. You may assume that the argument `n` is valid.

Answer: {"fn_name": "to_bytes", "inputs": [[0], [1]], "outputs": [[["00000000"]], [["00000001"]]]}
user: # Kata Task

I have a cat and a dog.

I got them at the same time as kitten/puppy. That was `humanYears` years ago.

Return their respective ages now as [`humanYears`,`catYears`,`dogYears`]

NOTES:
* humanYears >= 1
* humanYears are whole numbers only

## Cat Years

* `15` cat years for first year
* `+9` cat years for second year
* `+4` cat years for each year after that

## Dog Years

* `15` dog years for first year
* `+9` dog years for second year
* `+5` dog years for each year after that



**References**

* http://www.catster.com/cats-101/calculate-cat-age-in-cat-years
* http://www.slate.com/articles/news_and_politics/explainer/2009/05/a_dogs_life.html



If you liked this Kata there is another related one here

Answer: {"fn_name": "human_years_cat_years_dog_years", "inputs": [[1], [2], [10]], "outputs": [[[1, 15, 15]], [[2, 24, 24]], [[10, 56, 64]]]}
user: Consider a sequence, which is formed by the following rule: next term is taken as the smallest possible non-negative integer, which is not yet in the sequence, so that `no 3` terms of sequence form an arithmetic progression.

## Example

`f(0) = 0` -- smallest non-negative  
`f(1) = 1` -- smallest non-negative, which is not yet in the sequence  
`f(2) = 3` -- since `0, 1, 2` form an arithmetic progression  
`f(3) = 4` -- neither of `0, 1, 4`, `0, 3, 4`, `1, 3, 4` form an arithmetic progression, so we can take smallest non-negative, which is larger than `3`  
`f(4) = 9` --  `5, 6, 7, 8` are not good, since `1, 3, 5`, `0, 3, 6`, `1, 4, 7`, `0, 4, 8` are all valid arithmetic progressions.  

etc...

## The task

Write a function `f(n)`, which returns the `n-th` member of sequence.

## Limitations

There are `1000` random tests with `0 <= n <= 10^9`, so you should consider algorithmic complexity of your solution.

Answer: {"fn_name": "sequence", "inputs": [[0], [1], [2], [3], [4], [5], [334], [123], [546], [1634], [14514]], "outputs": [[0], [1], [3], [4], [9], [10], [7329], [1084], [19929], [79707], [2305425]]}