meetforever/GRPO_CL huggingface dataset:
user: This is the performance edition of [this kata](https://www.codewars.com/kata/ulam-sequences). If you didn't do it yet, you should begin there.

---

The Ulam sequence U is defined by `u0=u`, `u1=v`, with the general term `u_n` for `n>2` given by the least integer expressible uniquely as the sum of two distinct earlier terms.  
In other words, the next number is always the smallest, unique sum of any two previous terms.

The first 10 terms of the sequence `U(u0=1, u1=2)` are `[1, 2, 3, 4, 6, 8, 11, 13, 16, 18]`.

* Here, the first term after the initial `1, 2` is obviously `3` since `3=1+2`.
* The next term is `4=1+3` (we don't have to worry about `4=2+2` since it is a sum of a single term instead of two distinct terms)
* `5` is not a member of the sequence since it is representable in two ways: `5=1+4=2+3`, but `6=2+4` is a member (since `3+3` isn't a valid calculation).

You'll have to write a code that creates an Ulam Sequence starting with `u0`, `u1` and containing `n` terms.

---

# ___The pitfall...___

While the passing solutions of the first version could have a time complexity of O(N^(3)) (or even O(N^(4))!!), with 20 tests up to 100 terms only, here you'll have to manage generation of sequences up to 1500 terms before time out.

___Inputs:___

* `u0` and `u1`: integers, greater than or equal to 1
* `n`: integer greater than 1, length of the returned list

___Configuration of the tests:___

```if:python
* 6 small fixed tests
* 20 random tests on small sequences (10 to 30 terms)
* 13 large random tests (1500 terms)
```
```if:ruby
* 6 small fixed tests
* 20 random tests on small sequences (10 to 30 terms)
* 16 large random tests (1500 terms)
```
```if:javascript,go
* 6 small fixed tests
* 40 random tests on small sequences (10 to 30 terms)
* 30 large random tests (2450 terms)
```

---

Description Reference: http://mathworld.wolfram.com/UlamSequence.html

Answer: {"fn_name": "ulam_sequence", "inputs": [[1, 2, 5], [3, 4, 5], [5, 6, 8]], "outputs": [[[1, 2, 3, 4, 6]], [[3, 4, 7, 10, 11]], [[5, 6, 11, 16, 17, 21, 23, 26]]]}
user: Create a function xMasTree(height) that returns a christmas tree of the correct height. The height is passed through to the function and the function should return a list containing each line of the tree. 
```
xMasTree(5) should return : ['____#____', '___###___', '__#####__', '_#######_', '#########', '____#____', '____#____']
xMasTree(3) should return : ['__#__', '_###_', '#####', '__#__', '__#__']
```
The final idea is for the tree to look like this if you decide to print each element of the list: 
``` 
xMasTree(5) will result in:
____#____              1
___###___              2
__#####__              3
_#######_              4
#########       -----> 5 - Height of Tree
____#____        1      
____#____        2 - Trunk/Stem of Tree

xMasTree(3) will result in:
__#__                  1
_###_                  2
#####          ----->  3 - Height of Tree
__#__           1
__#__           2 - Trunk/Stem of Tree
```
Pad with underscores i.e _ so each line is the same length. The last line forming the tree having only hashtags, no spaces. Also remember the trunk/stem of the tree.

Answer: {"fn_name": "xMasTree", "inputs": [[3], [7], [2], [4], [6]], "outputs": [[["__#__", "_###_", "#####", "__#__", "__#__"]], [["______#______", "_____###_____", "____#####____", "___#######___", "__#########__", "_###########_", "#############", "______#______", "______#______"]], [["_#_", "###", "_#_", "_#_"]], [["___#___", "__###__", "_#####_", "#######", "___#___", "___#___"]], [["_____#_____", "____###____", "___#####___", "__#######__", "_#########_", "###########", "_____#_____", "_____#_____"]]]}
user: ## Task

Your challenge is to write a function named `getSlope`/`get_slope`/`GetSlope` that calculates the slope of the line through two points.

## Input

```if:javascript,python
Each point that the function takes in is an array 2 elements long. The first number is the x coordinate and the second number is the y coordinate.
If the line through the two points is vertical or if the same point is given twice, the function should return `null`/`None`.
```

```if:csharp
`GetSlope` will take in two Point objects. If the line through the two points is vertical, or the two points are the same, return `null`.

The Point object:

~~~
public class Point : System.Object
{
  public double X;
  public double Y;
  
  public Point(double x, double y)
  {
    this.X = x;
    this.Y = y;
  }
  
  public override string ToString()
  {
    return $"({this.X}, {this.Y})";
  }
  
  public override bool Equals(object point)
  {
    // Typechecking
    if (point == null || point.GetType() != this.GetType())
    {
      return false;
    }
    
    return this.ToString() == point.ToString();
  }
}
~~~

```

Answer: {"fn_name": "getSlope", "inputs": [[[1, 1], [2, 2]], [[-5, -5], [9, 9]], [[1, 8], [2, 9]], [[8, 3], [-4, 5]], [[5, 3], [8, 9]], [[1, 3], [0, 3]], [[11, 1], [1, 11]], [[1, 1], [1, 2]], [[-5, 9], [-5, 12]], [[1, 1], [1, 1]], [[-5, 9], [-5, 9]]], "outputs": [[1], [1], [1], [-0.16666666666666666], [2], [0], [-1], [null], [null], [null], [null]]}
user: An ordered sequence of numbers from 1 to N is given. One number might have deleted from it, then the remaining numbers were mixed. Find the number that was deleted.

Example: 
 - The starting array sequence is `[1,2,3,4,5,6,7,8,9]`
 - The mixed array with one deleted number is `[3,2,4,6,7,8,1,9]`
 - Your function should return the int `5`.

If no number was deleted from the array and no difference with it, your function should return the int `0`.

Note that N may be 1 or less (in the latter case, the first array will be `[]`).

Answer: {"fn_name": "find_deleted_number", "inputs": [[[1, 2, 3, 4, 5, 6, 7, 8, 9], [5, 7, 9, 4, 8, 1, 2, 3]], [[1, 2, 3, 4, 5, 6, 7], [2, 3, 6, 1, 5, 4, 7]], [[1, 2, 3, 4, 5, 6, 7, 8, 9], [5, 7, 6, 9, 4, 8, 1, 2, 3]], [[1], []], [[], []]], "outputs": [[6], [0], [0], [1], [0]]}
user: # Task
 The sequence of `Chando` is an infinite sequence of all Chando's numbers in ascending order.

 A number is called `Chando's` if it is an integer that can be represented as a sum of different positive integer powers of 5.

 The first Chando's numbers is 5 (5^1). And the following nth Chando's numbers are:
 ```
 25  (5^2)
 30  (5^1 + 5^2)
 125 (5^3)
 130 (5^1 + 5^3)
 150 (5^2 + 5^3)
 ...
 ...
 ```

 Your task is to find the Chando's nth number for a given `n`.

# Input/Output


 - `[input]` integer `n`

  `1 <= n <= 7000`


 - `[output]` an integer

  nth Chando's number

Answer: {"fn_name": "nth_chandos_number", "inputs": [[1], [2], [9], [123], [23]], "outputs": [[5], [25], [630], [97530], [3280]]}
user: In another Kata I came across a weird `sort` function to implement. We had to sort characters as usual ( 'A' before 'Z' and 'Z' before 'a' ) except that the `numbers` had to be sorted **after** the `letters` ( '0' after 'z') !!!

(After a couple of hours trying to solve this unusual-sorting-kata I discovered final tests used **usual** sort (digits  **before** letters :-)

So, the `unusualSort/unusual_sort` function you'll have to code will sort `letters` as usual, but will put `digits` (or one-digit-long `numbers` ) **after** `letters`.

## Examples
```python
unusual_sort(["a","z","b"])  # -> ["a","b","z"]  as usual
unusual_sort(["a","Z","B"])  # -> ["B","Z","a"]  as usual

//... but ...
unusual_sort(["1","z","a"])  # -> ["a","z","1"]
unusual_sort(["1","Z","a"])  # -> ["Z","a","1"]
unusual_sort([3,2,1"a","z","b"])  # -> ["a","b","z",1,2,3]
unusual_sort([3,"2",1,"a","c","b"])  # -> ["a","b","c",1,"2",3]
```
**Note**: `digits` will be sorted **after** "`same-digit-numbers`", eg: `1` is before `"1"`, `"2"` after `2`.
```python
unusual_sort([3,"2",1,"1","3",2])  # -> [1,"1",2,"2",3,"3"]
```

You may assume that **argument** will always be an `array/list` of **characters** or **one-digit-long numbers**.

Answer: {"fn_name": "unusual_sort", "inputs": [[["0", "9", "8", "1", "7", "2", "6", "3", "5", "4"]], [["3", "2", "1", "c", "b", "a"]], [["c", "b", "a", "9", "5", "0", "X", "Y", "Z"]], [[3, "3", "2", 2, "2", "1", 1, "a", "b", "c"]], [[]], [[1]], [["a"]]], "outputs": [[["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], [["a", "b", "c", "1", "2", "3"]], [["X", "Y", "Z", "a", "b", "c", "0", "5", "9"]], [["a", "b", "c", 1, "1", 2, "2", "2", 3, "3"]], [[]], [[1]], [["a"]]]}
user: Given a list of white pawns on a chessboard (any number of them, meaning from 0 to 64 and with the possibility to be positioned everywhere), determine how many of them have their backs covered by another. 
Pawns attacking upwards since we have only white ones.

Please remember that a pawn attack(and defend as well) only the 2 square on the sides in front of him. https://en.wikipedia.org/wiki/Pawn_(chess)#/media/File:Pawn_(chess)_movements.gif

This is how the chess board coordinates are defined:
ABCDEFGH8♜♞♝♛♚♝♞♜7♟♟♟♟♟♟♟♟65432♙♙♙♙♙♙♙♙1♖♘♗♕♔♗♘♖

Answer: {"fn_name": "covered_pawns", "inputs": [[["f7", "b1", "h1", "c7", "h7"]], [["e5", "b2", "b4", "g4", "a1", "a5"]], [["a2", "b1", "c2"]], [["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "h1", "h2", "h3", "h4", "h5", "h6", "h7", "h8"]], [[]]], "outputs": [[0], [2], [2], [56], [0]]}
user: Count the number of divisors of a positive integer `n`.

Random tests go up to `n = 500000`.

## Examples
```python
divisors(4)  == 3  # 1, 2, 4
divisors(5)  == 2  # 1, 5
divisors(12) == 6  # 1, 2, 3, 4, 6, 12
divisors(30) == 8  # 1, 2, 3, 5, 6, 10, 15, 30
```

Answer: {"fn_name": "divisors", "inputs": [[1], [4], [5], [12], [25], [30], [4096]], "outputs": [[1], [3], [2], [6], [3], [8], [13]]}
user: For a pole vaulter, it is very important to begin the approach run at the best possible starting mark. This is affected by numerous factors and requires fine-tuning in practice. But there is a guideline that will help a beginning vaulter start at approximately the right location for the so-called "three-step approach," based on the vaulter's body height.

This guideline was taught to me in feet and inches, but due to the international nature of Codewars, I am creating this kata to use metric units instead.

You are given the following two guidelines to begin with:
(1) A vaulter with a height of 1.52 meters should start at 9.45 meters on the runway.
(2) A vaulter with a height of 1.83 meters should start at 10.67 meters on the runway.

You will receive a vaulter's height in meters (which will always lie in a range between a minimum of 1.22 meters and a maximum of 2.13 meters). Your job is to return the best starting mark in meters, rounded to two decimal places.

Hint: Based on the two guidelines given above, you will want to account for the change in starting mark per change in body height. This involves a linear relationship. But there is also a constant offset involved. If you can determine the rate of change described above, you should be able to determine that constant offset.

Answer: {"fn_name": "starting_mark", "inputs": [[1.52], [1.83], [1.22], [2.13], [1.75]], "outputs": [[9.45], [10.67], [8.27], [11.85], [10.36]]}
user: Complete the function that accepts a valid string and returns an integer.

Wait, that would be too easy! Every character of the string should be converted to the hex value of its ascii code, then the result should be the sum of the numbers in the hex strings (ignore letters).

## Examples
```
"Yo" ==> "59 6f" ==> 5 + 9 + 6 = 20
"Hello, World!"  ==> 91
"Forty4Three"    ==> 113
```

Answer: {"fn_name": "hex_hash", "inputs": [["kcxnjsklsHskjHDkl7878hHJk"], [""], ["ThisIsATest!"], ["dhsajkbfyewquilb4y83q903ybr8q9apf7\\9ph79qw0-eq230br[wq87r0=18-[#20r370B 7Q0RFP23B79037902RF79WQ0[]]]"]], "outputs": [[218], [0], [120], [802]]}
user: Count how often sign changes in array.

### result
number from `0` to ... . Empty array returns `0`

### example

Answer: {"fn_name": "catch_sign_change", "inputs": [[[-7, -7, 7, 0]], [[1, 5, 2, -4]], [[-8, 4, -1, 5, -3, -3, -2, -2]], [[-2, -2, -5, -4, 5, 2, 0, 6, 0]], [[2, 6, 3, 0, 5, -3]], [[-3, 3]], [[-1, 2, 2, 2, 2, -8, -1]], [[1, -2, -7, -4, 4, -2, 0, -3, 3]], [[3, 7, -6, 2, 3, 1, 1]], [[13, -7, -6, 2, -1, 1, -1]], [[]], [[0]], [[4, 1]], [[-1, -2, -3]]], "outputs": [[1], [1], [4], [1], [1], [1], [2], [6], [2], [5], [0], [0], [0], [0]]}
user: Create a function that returns the average of an array of numbers ("scores"), rounded to the nearest whole number. You are not allowed to use any loops (including for, for/in, while, and do/while loops).

Answer: {"fn_name": "average", "inputs": [[[5, 78, 52, 900, 1]], [[5, 25, 50, 75]], [[2]], [[1, 1, 1, 1, 9999]], [[0]]], "outputs": [[207], [39], [2], [2001], [0]]}
user: ## Task
 You are given an array of integers. On each move you are allowed to increase exactly one of its element by one. Find the minimal number of moves required to obtain a strictly increasing sequence from the input.

## Example

 For `arr = [1, 1, 1]`, the output should be `3`.

## Input/Output


 - `[input]` integer array `arr`

    Constraints:

    `3 ≤ inputArray.length ≤ 100,`

    `-10000 ≤ inputArray[i] ≤ 10000.`
    

 - `[output]` an integer

    The minimal number of moves needed to obtain a strictly increasing sequence from inputArray.

    It's guaranteed that for the given test cases the answer always fits signed 32-bit integer type.

Answer: {"fn_name": "array_change", "inputs": [[[1, 1, 1]], [[-1000, 0, -2, 0]], [[2, 1, 10, 1]], [[2, 3, 3, 5, 5, 5, 4, 12, 12, 10, 15]]], "outputs": [[3], [5], [12], [13]]}
user: A hero is on his way to the castle to complete his mission. However, he's been told that the castle is surrounded with a couple of powerful dragons! each dragon takes 2 bullets to be defeated, our hero has no idea how many bullets he should carry.. Assuming he's gonna grab a specific given number of bullets and move forward to fight another specific given number of dragons, will he survive?

Return True if yes, False otherwise :)

Answer: {"fn_name": "hero", "inputs": [[10, 5], [7, 4], [4, 5], [100, 40], [1500, 751], [0, 1]], "outputs": [[true], [false], [false], [true], [false], [false]]}
user: You are given two strings. In a single move, you can choose any of them, and delete the first (i.e. leftmost) character.

For Example:

* By applying a move to the string `"where"`, the result is the string `"here"`.
* By applying a move to the string `"a"`, the result is an empty string `""`.

Implement a function that calculates the minimum number of moves that should be performed to make the given strings equal.

## Notes

* Both strings consist of lowercase latin letters.
* If the string is already empty, you cannot perform any more delete operations.

Answer: {"fn_name": "shift_left", "inputs": [["test", "west"], ["test", "yes"], ["b", "ab"], ["abacabadabacaba", "abacabadacaba"], ["aaabc", "bc"], ["dark", "d"], ["dadc", "dddc"], ["nogkvcdldfpvlbkpedsecl", "nogkvcdldfpvlbkpedsecl"]], "outputs": [[2], [7], [1], [18], [3], [5], [4], [0]]}
user: You have an array of numbers.  
Your task is to sort ascending odd numbers but even numbers must be on their places.

Zero isn't an odd number and you don't need to move it. If you have an empty array, you need to return it.

*Example*
```python
sort_array([5, 3, 2, 8, 1, 4]) == [1, 3, 2, 8, 5, 4]
```

Answer: {"fn_name": "sort_array", "inputs": [[[5, 3, 2, 8, 1, 4, 11]], [[2, 22, 37, 11, 4, 1, 5, 0]], [[1, 111, 11, 11, 2, 1, 5, 0]], [[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[0, 1, 2, 3, 4, 9, 8, 7, 6, 5]]], "outputs": [[[1, 3, 2, 8, 5, 4, 11]], [[2, 22, 1, 5, 4, 11, 37, 0]], [[1, 1, 5, 11, 2, 11, 111, 0]], [[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[0, 1, 2, 3, 4, 5, 8, 7, 6, 9]]]}
user: # Pythagorean Triples

A Pythagorean triplet is a set of three numbers a, b, and c where `a^2 + b^2 = c^2`. In this Kata, you will be tasked with finding the Pythagorean triplets whose product is equal to `n`, the given argument to the function `pythagorean_triplet`.

## Your task

In this Kata, you will be tasked with finding the Pythagorean triplets whose product is equal to `n`, the given argument to the function, where `0 < n < 10000000`


## Examples

One such triple is `3, 4, 5`. For this challenge, you would be given the value `60` as the argument to your function, and then it would return the Pythagorean triplet in an array `[3, 4, 5]` which is returned in increasing order. `3^2 + 4^2 = 5^2` since `9 + 16 = 25` and then their product (`3 * 4 * 5`) is `60`.


More examples:

| **argument** | **returns** |
| ---------|---------|
| 60       | [3, 4, 5] |
| 780      | [5, 12, 13] |
| 2040     | [8, 15, 17] |

Answer: {"fn_name": "pythagorean_triplet", "inputs": [[60], [780], [2040], [4200], [12180], [120120], [192720], [328860], [907200], [1440600]], "outputs": [[[3, 4, 5]], [[5, 12, 13]], [[8, 15, 17]], [[7, 24, 25]], [[20, 21, 29]], [[33, 56, 65]], [[48, 55, 73]], [[60, 63, 87]], [[42, 144, 150]], [[49, 168, 175]]]}
user: Write function describeList which returns "empty" if the list is empty or "singleton" if it contains only one element or "longer"" if more.

Answer: {"fn_name": "describeList", "inputs": [[[]], [[1]], [[1, 2, 5, 4]], [["one"]], [["one", "two"]], [[[1, 2]]]], "outputs": [["empty"], ["singleton"], ["longer"], ["singleton"], ["longer"], ["singleton"]]}
user: Define n!! as

n!! = 1 \* 3 \* 5 \* ... \* n  if n is odd, 

n!! = 2 \* 4 \* 6 \* ... \* n  if n is even. 

Hence 8!! = 2 \* 4 \* 6 \* 8 = 384, there is no zero at the end. 
30!! has 3 zeros at the end. 

For a positive integer n, please count how many zeros are there at 
the end of n!!. 

Example: 

count\_zeros\_n\_double\_fact(30) should return 3

Answer: {"fn_name": "count_zeros_n_double_fact", "inputs": [[8], [30], [487], [500]], "outputs": [[0], [3], [0], [62]]}
user: Given a string, capitalize the letters that occupy even indexes and odd indexes separately, and return as shown below. Index `0` will be considered even.

For example, `capitalize("abcdef") = ['AbCdEf', 'aBcDeF']`. See test cases for more examples.

The input will be a lowercase string with no spaces.

Good luck!

If you like this Kata, please try: 

[Indexed capitalization](https://www.codewars.com/kata/59cfc09a86a6fdf6df0000f1)

[Even-odd disparity](https://www.codewars.com/kata/59c62f1bdcc40560a2000060)

Answer: {"fn_name": "capitalize", "inputs": [["abcdef"], ["codewars"], ["abracadabra"], ["codewarriors"], ["indexinglessons"], ["codingisafunactivity"]], "outputs": [[["AbCdEf", "aBcDeF"]], [["CoDeWaRs", "cOdEwArS"]], [["AbRaCaDaBrA", "aBrAcAdAbRa"]], [["CoDeWaRrIoRs", "cOdEwArRiOrS"]], [["InDeXiNgLeSsOnS", "iNdExInGlEsSoNs"]], [["CoDiNgIsAfUnAcTiViTy", "cOdInGiSaFuNaCtIvItY"]]]}
user: This is simple version of harder [Square Sums](/kata/square-sums).

# Square sums

Write function `square_sums_row` (or `squareSumsRow`/`SquareSumsRow` depending on language rules) that, given integer number `N` (in range `2..43`), returns array of integers `1..N` arranged in a way, so sum of each 2 consecutive numbers is a square.

Solution is valid if and only if following two criterias are met:
1. Each number in range `1..N` is used once and only once.
2. Sum of each 2 consecutive numbers is a perfect square.

### Example
For N=15 solution could look like this:

`[ 9, 7, 2, 14, 11, 5, 4, 12, 13, 3, 6, 10, 15, 1, 8 ]`

### Verification

1. All numbers are used once and only once. When sorted in ascending order array looks like this:

`[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]`

2. Sum of each 2 consecutive numbers is a perfect square:

```
   16    16     16     16     16     16     16
   /+\   /+\    /+\    /+\    /+\    /+\    /+\
[ 9, 7, 2, 14, 11, 5, 4, 12, 13, 3, 6, 10, 15, 1, 8 ]
      \+/    \+/    \+/    \+/    \+/    \+/    \+/
       9     25      9     25      9     25      9

9 = 3*3
16 = 4*4
25 = 5*5
```

If there is no solution, return `false` (or, `None` in scala). For example if `N=5`, then numbers `1,2,3,4,5` cannot be put into square sums row: `1+3=4`, `4+5=9`, but
`2` has no pairs and cannot link `[1,3]` and `[4,5]`

# Have fun!

Harder version of this Kata is [here](/kata/square-sums).

Answer: {"fn_name": "square_sums_row", "inputs": [[5], [24]], "outputs": [[false], [false]]}
user: A Madhav array has the following property:

```a[0] = a[1] + a[2] = a[3] + a[4] + a[5] = a[6] + a[7] + a[8] + a[9] = ...```

Complete the function/method that returns `true` if the given array is a Madhav array, otherwise it returns `false`.

*Edge cases: An array of length* `0` *or* `1` *should not be considered a Madhav array as there is nothing to compare.*

Answer: {"fn_name": "is_madhav_array", "inputs": [[[6, 2, 4, 2, 2, 2, 1, 5, 0, 0]], [[6, 2, 4, 2, 2, 2, 1, 5, 0, -100]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, -2, -1]], [[-6, -3, -3, 8, -5, -4]], [[-6, -3, -3, 8, -10, -4]], [[3, 1, 2, 3, 0]], [[3, 3]], [[]], [[1]], [[5, 2, 4, 1, 0, 3]], [[6, 2, 4, 2, 2, 2, 1, 5, 0, 0, -12, 13, -5, 4, 6]], [[6, 2, 4, 2, 2, 2, 1, 5, 0, 0, -12, 13, -5, 4, 1]], [[2, 1, 1]], [[2, 1, 1, 4, -1, -1]]], "outputs": [[true], [false], [true], [false], [true], [false], [false], [false], [false], [false], [true], [false], [true], [true]]}
user: In your class, you have started lessons about [arithmetic progression](https://en.wikipedia.org/wiki/Arithmetic_progression). Since you are also a programmer, you have decided to write a function that will return the first `n` elements of the sequence with the given common difference `d` and first element `a`. Note that the difference may be zero!

The result should be a string of numbers, separated by comma and space.

## Example

```python
# first element: 1, difference: 2, how many: 5
arithmetic_sequence_elements(1, 2, 5) == "1, 3, 5, 7, 9"
```

~~~if:fortran
*NOTE: In Fortran, your returned string is* **not** *permitted to contain redundant leading/trailing whitespace.*
~~~

Answer: {"fn_name": "arithmetic_sequence_elements", "inputs": [[1, 2, 5], [1, 0, 5], [1, -3, 10], [100, -10, 10]], "outputs": [["1, 3, 5, 7, 9"], ["1, 1, 1, 1, 1"], ["1, -2, -5, -8, -11, -14, -17, -20, -23, -26"], ["100, 90, 80, 70, 60, 50, 40, 30, 20, 10"]]}
user: # The die is cast!

Your task in this kata is to write a "dice roller" that interprets a subset of [dice notation](http://en.wikipedia.org/wiki/Dice_notation).

# Description

In most role-playing games, die rolls required by the system are given in the form `AdX`. `A` and `X` are variables, separated by the letter **d**, which stands for *die* or *dice*.

 - `A` is the number of dice to be rolled (usually omitted if 1).
 - `X` is the number of faces of each die.

Here are some examples of input:

# Modifiers

As an addition to the above rules the input may also contain modifiers in the form `+N` or `-N` where `N` is an integer.

Here are some examples of input containing modifiers:

*Modifiers must be applied **after** all dice has been summed up.*

# Output

Your function must support two types of output depending on the second argument; *verbose* and *summed*.

## Summed output
If the verbose flag isn't set your function should sum up all the dice and modifiers and return the result as an integer.

## Verbose output
With the verbose flag your function should return an object/hash containing an array (`dice`) with all the dice rolls, and a integer (`modifier`) containing the sum of the modifiers which defaults to zero.

Example of verbose output:

# Invalid input
Here are some examples of invalid inputs:

# Additional information

 - Your solution should ignore all whitespace.
 - `roll` should return `false` for invalid input.

Answer: {"fn_name": "roll", "inputs": [[""], [{}], ["abc"], ["2d6+3 abc"], ["abc 2d6+3"], ["2d6++4"]], "outputs": [[false], [false], [false], [false], [false], [false]]}