meetforever/GRPO_CL huggingface dataset:
user: You have to create a function which receives 3 arguments: 2 numbers, and the result of an unknown operation performed on them (also a number).

Based on those 3 values you have to return a string, that describes which operation was used to get the given result.

The possible return strings are:
  `"addition"`,
  `"subtraction"`,
  `"multiplication"`,
  `"division"`.

## Example:
```
calcType(1, 2, 3) -->   1 ? 2 = 3   --> "addition"
```

## Notes
* In case of division you should expect that the result of the operation is obtained by using `/` operator on the input values - no manual data type conversion or rounding should be performed.
* Cases with just one possible answers are generated.
* Only valid arguments will be passed to the function.

Answer: {"fn_name": "calc_type", "inputs": [[1, 2, 3], [10, 5, 5], [10, 4, 40], [9, 5, 1.8]], "outputs": [["addition"], ["subtraction"], ["multiplication"], ["division"]]}
user: Given a string that includes alphanumeric characters ('3a4B2d') return the expansion of that string: The numeric values represent the occurrence of each letter preceding that numeric value. There should be no numeric characters in the final string. Empty strings should return an empty string. 
 
The first occurrence of a numeric value should be the number of times each character behind it is repeated, until the next numeric value appears.
```python
string_expansion('3D2a5d2f') == 'DDDaadddddff'
```
```python
string_expansion('3abc') == 'aaabbbccc'       # correct
string_expansion('3abc') != 'aaabc'           # wrong
string_expansion('3abc') != 'abcabcabc'       # wrong
```
If there are two consecutive numeric characters the first one is ignored.

```python
string_expansion('3d332f2a') == 'dddffaa'
```
If there are two consecutive alphabetic characters then the first character has no effect on the one after it.

```python
string_expansion('abcde') == 'abcde'
```
Your code should be able to work for both lower and capital case letters.

```python
string_expansion('') == ''
```

Answer: {"fn_name": "string_expansion", "inputs": [["3D2a5d2f"], ["4D1a8d4j3k"], ["4D2a8d4j2f"], ["3n6s7f3n"], ["0d4n8d2b"], ["0c3b1n7m"], ["7m3j4ik2a"], ["3A5m3B3Y"], ["5M0L8P1"], ["2B"], ["7M1n3K"], ["A4g1b4d"], ["111111"], ["4d324n2"], ["5919nf3u"], ["2n1k523n4i"], ["6o23M32d"], ["1B44n3r"], ["M21d1r32"], ["23M31r2r2"], ["8494mM25K2A"], ["4A46D6B3C"], ["23D42B3A"], ["143D36C1A"], ["asdf"], ["23jbjl1eb"], ["43ibadsr3"], ["123p9cdbjs"], ["2309ew7eh"], ["312987rfebd"], ["126cgec"], ["1chwq3rfb"], ["389fg21c"], ["239vbsac"], ["davhb327vuc"], ["cvyb239bved2dv"], [""]], "outputs": [["DDDaadddddff"], ["DDDDaddddddddjjjjkkk"], ["DDDDaaddddddddjjjjff"], ["nnnssssssfffffffnnn"], ["nnnnddddddddbb"], ["bbbnmmmmmmm"], ["mmmmmmmjjjiiiikkkkaa"], ["AAAmmmmmBBBYYY"], ["MMMMMPPPPPPPP"], ["BB"], ["MMMMMMMnKKK"], ["Aggggbdddd"], [""], ["ddddnnnn"], ["nnnnnnnnnfffffffffuuu"], ["nnknnniiii"], ["ooooooMMMdd"], ["Bnnnnrrr"], ["Mdr"], ["MMMrrr"], ["mmmmMMMMKKKKKAA"], ["AAAADDDDDDBBBBBBCCC"], ["DDDBBAAA"], ["DDDCCCCCCA"], ["asdf"], ["jjjbbbjjjllleb"], ["iiibbbaaadddsssrrr"], ["pppcccccccccdddddddddbbbbbbbbbjjjjjjjjjsssssssss"], ["eeeeeeeeewwwwwwwwweeeeeeehhhhhhh"], ["rrrrrrrfffffffeeeeeeebbbbbbbddddddd"], ["ccccccggggggeeeeeecccccc"], ["chwqrrrfffbbb"], ["fffffffffgggggggggc"], ["vvvvvvvvvbbbbbbbbbsssssssssaaaaaaaaaccccccccc"], ["davhbvvvvvvvuuuuuuuccccccc"], ["cvybbbbbbbbbbvvvvvvvvveeeeeeeeedddddddddddvv"], [""]]}
user: Once upon a time, a CodeWarrior, after reading a [discussion on what can be the plural](http://www.codewars.com/kata/plural/discuss/javascript), took a look at [this page](http://en.wikipedia.org/wiki/Grammatical_number#Types_of_number
) and discovered that **more than 1** "kind of plural" may exist. 

For example [Sursurunga Language](http://en.wikipedia.org/wiki/Sursurunga_language) distinguishes 5 types of numbers: **singular** (1 thing), **dual** (2 things), '**trial**' or '**lesser paucal**' (3 or 4), '**greater paucal**' (more than 4) and **plural** (many).

In this kata, you'll have to handle only four types of numbers:

- **singular**: 0 or 1 thing
- **dual**: 2 things
- **paucal**: 3 to 9 things
- **plural**: more than 9 things

To add some flavor the **number-marker** will not be added in same places:

- **singular**, no marker : `1 cat`
- **dual**, prefixed "`bu`" : `2 cats -> 2 bucat`
- **paucal**, suffixed "`zo`" : `4 cats -> 4 catzo`
- **plural**, "circumfixed `ga`" : `100 cats -> 100 gacatga`

As you all ("hawk eyes") have seen, the final `s` of english plural **disappears**.

( btw these markers, of course, have absolutely nothing to do with true sursurunga language, we're just talking about "**pig**-sursurunga" with **pig** as **pig** in "**pig latin**" )

## Your Job . . .
. . . if you accept it, will be to write a `sursurungal` function which get a `string` as argument and returns this string with words in it eventually converted to their "pig-sursurunga number type".

If a `number` ( *ie* 1 or more digit ) + a `space` + a `word` ( letters ) are found then the word should be converted.

**Each** group of `number+space+word` found in the string should be evaluated.

### Examples :

You may assume at least 1 `number+space+word` group will be provided.

**Beware** `s` of english plural should be removed, not ending `s` of some singular words ( *eg* "kiss" )

Good luck!

Answer: {"fn_name": "sursurungal", "inputs": [["1 tomato"], ["0 tomato"], ["1 ananas"], ["2 bananas"], ["3 bananas"], ["10 bananas"], ["111 bananas"], ["6 birds with 2 wings each = 12 legs"], ["\n3 pigs\nmet 1 wolf\n2 days ago"]], "outputs": [["1 tomato"], ["0 tomato"], ["1 ananas"], ["2 bubanana"], ["3 bananazo"], ["10 gabananaga"], ["111 gabananaga"], ["6 birdzo with 2 buwing each = 12 galegga"], ["\n3 pigzo\nmet 1 wolf\n2 buday ago"]]}
user: Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (`HH:MM:SS`)

* `HH` = hours, padded to 2 digits, range: 00 - 99
* `MM` = minutes, padded to 2 digits, range: 00 - 59
* `SS` = seconds, padded to 2 digits, range: 00 - 59

The maximum time never exceeds 359999 (`99:59:59`)

You can find some examples in the test fixtures.

Answer: {"fn_name": "make_readable", "inputs": [[0], [59], [60], [3599], [3600], [86399], [86400], [359999]], "outputs": [["00:00:00"], ["00:00:59"], ["00:01:00"], ["00:59:59"], ["01:00:00"], ["23:59:59"], ["24:00:00"], ["99:59:59"]]}
user: _Friday 13th or Black Friday is considered as unlucky day. Calculate how many unlucky days are in the given year._

Find the number of Friday 13th in the given year.

__Input:__ Year as an integer.

__Output:__ Number of Black Fridays in the year as an integer.

__Examples:__

        unluckyDays(2015) == 3
        unluckyDays(1986) == 1

***Note:*** In Ruby years will start from 1593.

Answer: {"fn_name": "unlucky_days", "inputs": [[1634], [2873], [1586]], "outputs": [[2], [2], [1]]}
user: Lot of museum allow you to be a member, for a certain amount `amount_by_year` you can have unlimitted acces to the museum. 

In this kata you should complete a function in order to know after how many visit it will be better to take an annual pass. The function take 2 arguments `annual_price` and `individual_price`.

Answer: {"fn_name": "how_many_times", "inputs": [[40, 15], [30, 10], [80, 15]], "outputs": [[3], [3], [6]]}
user: Each floating-point number should be formatted that only the first two decimal places are returned. You don't need to check whether the input is a valid number because only valid numbers are used in the tests.  

Don't round the numbers! Just cut them after two decimal places!
```
Right examples:  
32.8493 is 32.84  
14.3286 is 14.32

Incorrect examples (e.g. if you round the numbers):  
32.8493 is 32.85  
14.3286 is 14.33
```

Answer: {"fn_name": "two_decimal_places", "inputs": [[10.1289767789], [-7488.83485834983], [4.653725356]], "outputs": [[10.12], [-7488.83], [4.65]]}
user: We all love the future president (or Führer or duce or sōtō as he could find them more fitting) donald trump, but we might fear that some of his many fans like John Miller or John Barron are not making him justice, sounding too much like their (and our as well, of course!) hero and thus risking to compromise him.

For this reason we need to create a function to detect the original and unique rythm of our beloved leader, typically having a lot of extra vowels, all ready to fight the estabilishment.

The index is calculated based on how many vowels are repeated more than once in a row and dividing them by the total number of vowels a petty enemy of America would use.

For example:
```python
trump_detector("I will build a huge wall")==0 #definitely not our trump: 0 on the trump score
trump_detector("HUUUUUGEEEE WAAAAAALL")==4 #4 extra "U", 3 extra "E" and 5 extra "A" on 3 different vowel groups: 12/3 make for a trumpy trumping score of 4: not bad at all!
trump_detector("listen migrants: IIII KIIIDD YOOOUUU NOOOOOOTTT")==1.56 #14 extra vowels on 9 base ones
```
**Notes:** vowels are only the ones in the patriotic group of "aeiou": "y" should go back to Greece if she thinks she can have the same rights of true American vowels; there is always going to be at least a vowel, as silence is the option of coward Kenyan/terrorist presidents and their friends.

Round each result by two decimal digits: there is no place for small fry in Trump's America.

*Special thanks for [Izabela](https://www.codewars.com/users/ijelonek) for support and proof-reading.*

Answer: {"fn_name": "trump_detector", "inputs": [["I will build a huge wall"], ["HUUUUUGEEEE WAAAAAALL"], ["MEXICAAAAAAAANS GOOOO HOOOMEEEE"], ["America NUUUUUKEEEE Oooobaaaamaaaaa"], ["listen migrants: IIII KIIIDD YOOOUUU NOOOOOOTTT"]], "outputs": [[0], [4], [2.5], [1.89], [1.56]]}
user: ### The Story:
Bob is working as a bus driver. However, he has become extremely popular amongst the city's residents. With so many passengers wanting to get aboard his bus, he sometimes has to face the problem of not enough space left on the bus! He wants you to write a simple program telling him if he will be able to fit all the passengers.

### Task Overview:

You have to write a function that accepts three parameters: 
* `cap` is the amount of people the bus can hold excluding the driver.
* `on` is the number of people on the bus.
* `wait` is the number of people waiting to get on to the bus. 

If there is enough space, return 0, and if there isn't, return the number of passengers he can't take.

### Usage Examples:

```python
enough(10, 5, 5)
0 # He can fit all 5 passengers
enough(100, 60, 50)
10 # He can't fit 10 out of 50 waiting
```

```if:csharp
Documentation:
Kata.Enough Method (Int32, Int32, Int32)

Returns the number of passengers the bus cannot fit, or 0 if the bus can fit every passenger.

Syntax


public
static
int Enough(
int cap,
    int on,
int wait
    )
  



Parameters

cap

Type: System.Int32
The amount of people that can fit on the bus excluding the driver.

on

Type: System.Int32
The amount of people on the bus excluding the driver.

wait

Type: System.Int32
The amount of people waiting to enter the bus.

Return Value

Type: System.Int32
  An integer representing how many passengers cannot fit on the bus, or 0 if every passenger can fit on the bus.

```

Answer: {"fn_name": "enough", "inputs": [[10, 5, 5], [100, 60, 50], [20, 5, 5]], "outputs": [[0], [10], [0]]}
user: The wide mouth frog is particularly interested in the eating habits of other creatures.

He just can't stop asking the creatures he encounters what they like to eat. But then he meet the alligator who just LOVES to eat wide-mouthed frogs!

When he meets the alligator, it then makes a tiny mouth.

Your goal in this kata is to create complete the `mouth_size` method this method take one argument `animal` which corresponds to the animal encountered by frog. If this one is an `alligator` (case insensitive) return `small` otherwise return `wide`.

Answer: {"fn_name": "mouth_size", "inputs": [["toucan"], ["ant bear"], ["alligator"]], "outputs": [["wide"], ["wide"], ["small"]]}
user: In this Kata, you will be given a number in form of a string and an integer `k` and your task is to insert `k` commas into the string and determine which of the partitions is the largest. 

```
For example:
solve('1234',1) = 234 because ('1','234') or ('12','34') or ('123','4').
solve('1234',2) = 34 because ('1','2','34') or ('1','23','4') or ('12','3','4'). 
solve('1234',3) = 4
solve('2020',1) = 202
```

More examples in test cases. Good luck!

Please also try [Simple remove duplicates](https://www.codewars.com/kata/5ba38ba180824a86850000f7)

Answer: {"fn_name": "solve", "inputs": [["1234", 1], ["1234", 2], ["1234", 3], ["2020", 1]], "outputs": [[234], [34], [4], [202]]}
user: In genetics, a sequence’s motif is a nucleotides (or amino-acid) sequence pattern. Sequence motifs have a biological significance. For more information you can take a look [here](https://en.wikipedia.org/wiki/Sequence_motif).


For this kata you need to complete the function `motif_locator`. This function receives 2 arguments - a sequence and a motif. Both arguments are strings.

You should return an array that contains all the start positions of the motif (in order). A sequence may contain 0 or more repetitions of the given motif. Note that the number of the first position is 1, not 0.

**Some examples:**

- For the `sequence` "ACGTGGGGACTAGGGG" and the `motif` "GGGG" the result should be [5, 13]. 
- For the `sequence` "ACCGTACCAAGGGACC" and the `motif` "AAT"  the result should be []
- For the `sequence` "GGG" and the motif "GG" the result should be [1, 2]

**Note**: You can take a look to my others bio-info kata [here](http://www.codewars.com/users/nbeck/authored)

Answer: {"fn_name": "motif_locator", "inputs": [["TTCCGGAACC", "CC"], ["ACGTTACAACGTTAG", "ACGT"], ["ACGTACGTACGT", "AAA"], ["ACGT", "ACGTGAC"]], "outputs": [[[3, 9]], [[1, 9]], [[]], [[]]]}
user: Create a function that takes in the sum and age difference of two people, calculates their individual ages, and returns a pair of values (oldest age first) if those exist or `null/None` if:

* `sum < 0`
* `difference < 0`
* Either of the calculated ages come out to be negative

Answer: {"fn_name": "get_ages", "inputs": [[24, 4], [30, 6], [70, 10], [18, 4], [63, 14], [80, 80], [63, -14], [-22, 15]], "outputs": [[[14, 10]], [[18, 12]], [[40, 30]], [[11, 7]], [[38.5, 24.5]], [[80, 0]], [null], [null]]}
user: Generate and return **all** possible increasing arithmetic progressions of six primes `[a, b, c, d, e, f]` between the given limits. Note: the upper and lower limits are inclusive.

An arithmetic progression is a sequence where the difference between consecutive numbers is the same, such as: 2, 4, 6, 8.

A prime number is a number that is divisible only by itself and 1 (e.g. 2, 3, 5, 7, 11)

Your solutions should be returned as lists inside a list in ascending order of the first item (if there are multiple lists with same first item, return in ascending order for the second item etc) are the e.g: `[ [a, b, c, d, e, f], [g, h, i, j, k, l] ]` where `a < g`. If there are no solutions, return an empty list: `[]`

## Examples

Answer: {"fn_name": "primes_a_p", "inputs": [[0, 200], [90, 600], [770, 1000], [30, 305], [1000, 4000]], "outputs": [[[[7, 37, 67, 97, 127, 157]]], [[[107, 137, 167, 197, 227, 257], [359, 389, 419, 449, 479, 509]]], [[]], [[[107, 137, 167, 197, 227, 257]]], [[[1013, 1193, 1373, 1553, 1733, 1913], [1039, 1249, 1459, 1669, 1879, 2089], [1039, 1609, 2179, 2749, 3319, 3889], [1091, 1301, 1511, 1721, 1931, 2141], [1201, 1471, 1741, 2011, 2281, 2551], [1289, 1709, 2129, 2549, 2969, 3389], [1301, 1511, 1721, 1931, 2141, 2351], [1307, 1487, 1667, 1847, 2027, 2207], [1321, 1531, 1741, 1951, 2161, 2371], [1381, 1831, 2281, 2731, 3181, 3631], [1451, 1901, 2351, 2801, 3251, 3701], [1453, 1663, 1873, 2083, 2293, 2503], [1511, 1811, 2111, 2411, 2711, 3011], [1619, 2039, 2459, 2879, 3299, 3719], [1663, 1873, 2083, 2293, 2503, 2713], [1669, 2029, 2389, 2749, 3109, 3469], [1973, 2063, 2153, 2243, 2333, 2423], [2129, 2459, 2789, 3119, 3449, 3779], [2207, 2447, 2687, 2927, 3167, 3407], [2221, 2251, 2281, 2311, 2341, 2371], [2339, 2459, 2579, 2699, 2819, 2939], [2351, 2441, 2531, 2621, 2711, 2801], [2377, 2647, 2917, 3187, 3457, 3727], [2437, 2557, 2677, 2797, 2917, 3037], [2467, 2617, 2767, 2917, 3067, 3217]]]]}
user: Given a string, turn each letter into its ASCII character code and join them together to create a number - let's call this number `total1`:

```
'ABC' --> 'A' = 65, 'B' = 66, 'C' = 67 --> 656667
```

Then replace any incidence of the number `7` with the number `1`, and call this number 'total2':
```
total1 = 656667
              ^
total2 = 656661
              ^
```

Then return the difference between the sum of the digits in `total1` and `total2`:

```
  (6 + 5 + 6 + 6 + 6 + 7)
- (6 + 5 + 6 + 6 + 6 + 1)
-------------------------
                       6
```

Answer: {"fn_name": "calc", "inputs": [["abcdef"], ["ifkhchlhfd"], ["aaaaaddddr"], ["jfmgklf8hglbe"], ["jaam"], ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"]], "outputs": [[6], [6], [30], [6], [12], [96]]}
user: Sometimes, I want to quickly be able to convert miles per imperial gallon into kilometers per liter.

Create an application that will display the number of kilometers per liter (output) based on the number of miles per imperial gallon (input).

Make sure to round off the result to two decimal points. If the answer ends with a 0, it should be rounded off without the 0. So instead of 5.50, we should get 5.5.

Some useful associations relevant to this kata:
1 Imperial Gallon = 4.54609188 litres
1 Mile = 1.609344 kilometres

Answer: {"fn_name": "converter", "inputs": [[10], [20], [30], [24], [36]], "outputs": [[3.54], [7.08], [10.62], [8.5], [12.74]]}
user: The aim of this kata is to split a given string into different strings of equal size (note size of strings is passed to the method)

Example:

    Split the below string into other strings of size #3

    'supercalifragilisticexpialidocious'

    Will return a new string
    'sup erc ali fra gil ist ice xpi ali doc iou s'


Assumptions:

    String length is always greater than 0
    String has no spaces
    Size is always positive

Answer: {"fn_name": "split_in_parts", "inputs": [["supercalifragilisticexpialidocious", 3], ["HelloKata", 1], ["HelloKata", 9]], "outputs": [["sup erc ali fra gil ist ice xpi ali doc iou s"], ["H e l l o K a t a"], ["HelloKata"]]}
user: Return the century of the input year. The input will always be a 4 digit string, so there is no need for validation. 

### Examples
```
"1999" --> "20th"
"2011" --> "21st"
"2154" --> "22nd"
"2259" --> "23rd"
"1124" --> "12th"
"2000" --> "20th"
```

Answer: {"fn_name": "what_century", "inputs": [["1999"]], "outputs": [["20th"]]}
user: A stick is balanced horizontally on a support. Will it topple over or stay balanced? (This is a physics problem: imagine a real wooden stick balanced horizontally on someone's finger or on a narrow table, for example). 

The stick is represented as a list, where each entry shows the mass in that part of the stick.

The stick is balanced on a support. The "terrain" is represented by a list of 1s and 0s, where the 1s represent the support and the 0s represent empty space. Each index is a coordinate on the x-axis, so e.g. the physical interpretations of some terrains are as follows:

![](https://i.imgur.com/P4MpHZV.png)

The stick will only balance if its centre of mass is directly above some part of its support. Return `True` if the stick will balance and `False` if it will topple.

Both lists will be of equal length (that is, the stick and the terrain have equal width so that each index of the stick is directly above the corresponding index of the terrain). Every terrain will contain one, and only one, support.

## Examples:

![](https://i.imgur.com/PyMBsAl.png)

```
[2,3,2]
[0,1,0] ---> Perfectly balanced, return True

[5,1,1]
[0,1,0] ---> will topple to the left, return False

[3,3,4]
[0,1,0] ---> will topple to the right (but only just)

[7,1,1,1,1,1,1,1]
[0,1,1,0,0,0,0,0] ---> will balance, perfectly, without a doubt

[5, 3, 2, 8, 6]
[0, 0, 0, 1, 1] ---> will topple to the left

```

Answer: {"fn_name": "will_it_balance", "inputs": [[[2, 3, 2], [0, 1, 0]], [[5, 1, 1], [0, 1, 0]], [[3, 3, 4], [0, 1, 0]], [[9, 7, 1, 1], [1, 1, 0, 0]], [[9, 1, 1, 7], [1, 1, 0, 0]]], "outputs": [[true], [false], [false], [true], [false]]}
user: # ASC Week 1 Challenge 5 (Medium #2)

Create a function that takes a 2D array as an input, and outputs another array that contains the average values for the numbers in the nested arrays at the corresponding indexes. 

Note: the function should also work with negative numbers and floats.

## Examples
```
[ [1, 2, 3, 4], [5, 6, 7, 8] ]  ==>  [3, 4, 5, 6]

1st array: [1, 2, 3, 4]
2nd array: [5, 6, 7, 8]
            |  |  |  |
            v  v  v  v
average:   [3, 4, 5, 6]

```

And another one:
```
[ [2, 3, 9, 10, 7], [12, 6, 89, 45, 3], [9, 12, 56, 10, 34], [67, 23, 1, 88, 34] ]  ==>  [22.5, 11, 38.75, 38.25, 19.5]

1st array: [  2,   3,    9,   10,    7]
2nd array: [ 12,   6,   89,   45,    3]
3rd array: [  9,  12,   56,   10,   34]
4th array: [ 67,  23,    1,   88,   34]
              |    |     |     |     |
              v    v     v     v     v
average:   [22.5, 11, 38.75, 38.25, 19.5]
```

Answer: {"fn_name": "avg_array", "inputs": [[[[1, 2, 3, 4], [5, 6, 7, 8]]], [[[2, 3, 9, 10, 7], [12, 6, 89, 45, 3], [9, 12, 56, 10, 34], [67, 23, 1, 88, 34]]], [[[2, 5, 4, 3, 19], [2, 5, 6, 7, 10]]], [[[1.2, 8.521, 0.4, 3.14, 1.9], [2, 4.5, 3.75, 0.987, 1.0]]], [[[2, 5, -4, 3, -19], [-2, -5, 6, 7, 10]]], [[[-2, -18, -45, -10], [0, -45, -20, -34]]]], "outputs": [[[3, 4, 5, 6]], [[22.5, 11, 38.75, 38.25, 19.5]], [[2, 5, 5, 5, 14.5]], [[1.6, 6.5105, 2.075, 2.0635, 1.45]], [[0, 0, 1, 5, -4.5]], [[-1, -31.5, -32.5, -22]]]}
user: # Task

John won the championship of a TV show. He can get some bonuses.

He needs to play a game to determine the amount of his bonus.

Here are some cards in a row. A number is written on each card.

In each turn, John can take a card, but only from the beginning or the end of the row. Then multiply the number on the card by an coefficient 2^(i)(i means the ith turn). The product is John's bonus of current turn.

After all the cards are taken away, the game is over. John's final bonus is the sum of all rounds of bonuses.

Obviously, the order in which John takes the cards will affect the amount of John's final bonus.

Your task is to help John calculate the maximum amount of bonuses he can get.

# Input

- `cards`: An integer array. Each element represents the number on the card.
  - `1 <= cards.length <= 30`
  - `1 <= cards[i] <= 100`


- All inputs are valid.

# Output

An integer. the maximum amount of bonuses John can get.

# Eaxmple

For `cards=[1,2,5]`, the output should be `50`.

```
All possible orders are:
1->2->5   bonus:1x2+2*4+5*8=50
1->5->2   bonus:1x2+5*4+2*8=38
5->1->2   bonus:5*2+1*4+2*8=30
5->2->1   bonus:5*2+2*4+1*8=26
The maximum amount of bonus is 50.
```

Answer: {"fn_name": "calc", "inputs": [[[1, 2, 5]], [[1]], [[1, 1]], [[1, 2, 1]], [[4, 10, 2, 3, 1, 3, 1, 6, 9]]], "outputs": [[50], [2], [6], [22], [6722]]}
user: In input string ```word```(1 word):
* replace the vowel with the nearest left consonant.
* replace the consonant with the nearest right vowel.

P.S. To complete this task imagine the alphabet is a circle (connect the first and last element of the array in the mind). For example, 'a' replace with 'z', 'y' with 'a', etc.(see below)

For example:
```
'codewars' => 'enedazuu'
'cat' => 'ezu'
'abcdtuvwxyz' => 'zeeeutaaaaa'
```

It is preloaded: 

```
const alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
const consonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z'];
const vowels = ['a','e','i','o','u'];
```

P.S. You work with lowercase letters only.

Answer: {"fn_name": "replace_letters", "inputs": [["cat"], ["codewars"], ["abcdtuvwxyz"]], "outputs": [["ezu"], ["enedazuu"], ["zeeeutaaaaa"]]}