meetforever/GRPO_CL huggingface dataset:
user: Some languages like Chinese, Japanese, and Thai do not have spaces between words. However, most natural languages processing tasks like part-of-speech tagging require texts that have segmented words. A simple and reasonably effective algorithm to segment a sentence into its component words is called "MaxMatch".

## MaxMatch
MaxMatch starts at the first character of a sentence and tries to find the longest valid word starting from that character. If no word is found, the first character is deemed the longest "word", regardless of its validity. In order to find the rest of the words, MaxMatch is then recursively invoked on all of the remaining characters until no characters remain. A list of all of the words that were found is returned.

So for the string `"happyday"`, `"happy"` is found because `"happyday"` is not a valid word, nor is `"happyda"`, nor `"happyd"`. Then, MaxMatch is called on `"day"`, and `"day"` is found. The output is the list `["happy", "day"]` in that order.

## The Challenge

```if:javascript
Write `maxMatch`, which takes an alphanumeric, spaceless, lowercased `String` as input and returns an `Array` of all the words found, in the order they were found.
**All valid words are in the** `Set` `VALID_WORDS`, which only contains around 500 English words.
```
```if:haskell
Write `maxMatch`, which takes an alphanumeric, spaceless, lowercased `String` as input and returns a `[String]` of all the words found, in the order they were found. All valid words are in the `[String]` `validWords`, which only contains around 500 English words.
```
```if:java
Write `maxMatch`, which takes an alphanumeric, spaceless, lowercased `String` as input and returns a `List` of `String`s which are all the words found, in the order they were found. All valid words are in the `Set` `Preloaded.VALID_WORDS`, , which only contains around 500 English words.
```
```if:python
Write `max_match`, which takes an alphanumeric, spaceless, lowercased `String` as input and returns a `List` of `String`s of all the words found, in the order they were found. **All valid words are in the** `Set` `VALID_WORDS`, which only contains around 500 English words.
```
```if:ruby
Write `max_match`, which takes an alphanumeric, spaceless, lowercased `String` as input and returns an `Array` of `String`s of all the words found, in the order they were found. All valid words are in the `Array` `VALID_WORDS`, which only contains around 500 English words.
```
```if:kotlin
Write `maxMatch`, which takes an alphanumeric, spaceless, lowercased `String` as input and returns a `List` of `String`s which are all the words found, in the order they were found. All valid words are in the `Set` `VALID_WORDS`, which only contains around 500 English words.
```
**Note:** This algorithm is simple and operates better on Chinese text, so accept the fact that some words will be segmented wrongly.

Happy coding :)

Answer: {"fn_name": "max_match", "inputs": [[""]], "outputs": [[[]]]}
user: # Task
Imagine `n` horizontal lines and `m` vertical lines.

Some of these lines intersect, creating rectangles.

How many rectangles are there?

# Examples

For `n=2, m=2,` the result should be `1`.

there is only one 1x1 rectangle.

For `n=2, m=3`, the result should be `3`.

there are two 1x1 rectangles and one 1x2 rectangle. So `2 + 1 = 3`.

For n=3, m=3, the result should be `9`.

there are four 1x1 rectangles, two 1x2 rectangles, two 2x1 rectangles and one 2x2 rectangle. So `4 + 2 + 2 + 1 = 9`.



# Input & Output


- `[input]` integer `n`

Number of horizontal lines.

Constraints: `0 <= n <= 100`


- `[input]` integer `m`

Number of vertical lines.

Constraints: `0 <= m <= 100`


- `[output]` an integer

Number of rectangles.

Answer: {"fn_name": "rectangles", "inputs": [[2, 3], [2, 2], [1, 1], [0, 1], [3, 3], [100, 100]], "outputs": [[3], [1], [0], [0], [9], [24502500]]}
user: You will be given a fruit which a farmer has harvested, your job is to see if you should buy or sell.

You will be given 3 pairs of fruit. Your task is to trade your harvested fruit back into your harvested fruit via the intermediate pair, you should return a string of 3 actions.

if you have harvested apples, you would buy this fruit pair: apple_orange, if you have harvested oranges, you would sell that fruit pair.

(In other words, to go from left to right (apples to oranges) you buy, and to go from right to left you sell (oranges to apple))

e.g. 
apple_orange, orange_pear, apple_pear
1. if you have harvested apples, you would buy this fruit pair: apple_orange
2. Then you have oranges, so again you would buy this fruit pair: orange_pear
3. After you have pear, but now this time you would sell this fruit pair: apple_pear
4. Finally you are back with the apples

So your function would return a list: [“buy”,”buy”,”sell”]

If any invalid input is given, "ERROR" should be returned

Answer: {"fn_name": "buy_or_sell", "inputs": [[[["apple", "orange"], ["orange", "pear"], ["apple", "pear"]], "apple"], [[["orange", "apple"], ["orange", "pear"], ["pear", "apple"]], "apple"], [[["apple", "orange"], ["pear", "orange"], ["apple", "pear"]], "apple"], [[["orange", "apple"], ["pear", "orange"], ["pear", "apple"]], "apple"], [[["orange", "apple"], ["orange", "pear"], ["apple", "pear"]], "apple"], [[["apple", "orange"], ["pear", "orange"], ["pear", "apple"]], "apple"], [[["apple", "orange"], ["orange", "pear"], ["pear", "apple"]], "apple"], [[["orange", "apple"], ["pear", "orange"], ["apple", "pear"]], "apple"], [[["orange", "apple"], ["pear", "orange"], ["apple", "paer"]], "apple"]], "outputs": [[["buy", "buy", "sell"]], [["sell", "buy", "buy"]], [["buy", "sell", "sell"]], [["sell", "sell", "buy"]], [["sell", "buy", "sell"]], [["buy", "sell", "buy"]], [["buy", "buy", "buy"]], [["sell", "sell", "sell"]], ["ERROR"]]}
user: Maya writes weekly articles to a well known magazine, but she is missing one word each time she is about to send the article to the editor. The article is not complete without this word. Maya has a friend, Dan, and he is very good with words, but he doesn't like to just give them away. He texts Maya a number and she needs to find out the hidden word. 
The words can contain only the letter: "a", "b", "d", "e", "i", "l", "m", "n", "o", and "t".

Luckily, Maya has the key:

"a" - 6
"b" - 1 
"d" - 7
"e" - 4
"i" - 3
"l" - 2
"m" - 9
"n" - 8
"o" - 0
"t" - 5

You can help Maya by writing a function that will take a number between 100 and 999999 and return a string with the word. 

The input is always a number, contains only the numbers in the key. 
The output should be always a string with one word, all lowercase.

Maya won't forget to thank you at the end of her article :)

Answer: {"fn_name": "hidden", "inputs": [[637], [7468], [49632], [1425], [6250], [12674], [4735], [7345], [3850], [2394], [2068], [137], [1065], [6509], [3549], [5394], [56124], [968], [103247], [67935], [7415], [2687], [261], [8054], [942547]], "outputs": [["aid"], ["dean"], ["email"], ["belt"], ["alto"], ["blade"], ["edit"], ["diet"], ["into"], ["lime"], ["loan"], ["bid"], ["boat"], ["atom"], ["item"], ["time"], ["table"], ["man"], ["boiled"], ["admit"], ["debt"], ["land"], ["lab"], ["note"], ["melted"]]}
user: # Task
 Call two arms equally strong if the heaviest weights they each are able to lift are equal.

 Call two people equally strong if their strongest arms are equally strong (the strongest arm can be both the right and the left), and so are their weakest arms.

 Given your and your friend's arms' lifting capabilities find out if you two are equally strong.

# Example

 For `yourLeft = 10, yourRight = 15, friendsLeft = 15 and friendsRight = 10`, the output should be `true`;
 
 For `yourLeft = 15, yourRight = 10, friendsLeft = 15 and friendsRight = 10`, the output should be `true`;
 
 For `yourLeft = 15, yourRight = 10, friendsLeft = 15 and friendsRight = 9,` the output should be `false`.
 
# Input/Output


 - `[input]` integer `yourLeft`

    A non-negative integer representing the heaviest weight you can lift with your left arm.
    

 - `[input]` integer `yourRight`

    A non-negative integer representing the heaviest weight you can lift with your right arm.


 - `[input]` integer `friendsLeft`

    A non-negative integer representing the heaviest weight your friend can lift with his or her left arm.


 - `[input]` integer `friendsRight`

    A non-negative integer representing the heaviest weight your friend can lift with his or her right arm.


 - `[output]` a boolean value

Answer: {"fn_name": "are_equally_strong", "inputs": [[10, 15, 15, 10], [15, 10, 15, 10], [10, 10, 10, 10], [15, 10, 15, 9], [10, 5, 5, 10], [1, 10, 10, 0], [10, 5, 11, 4]], "outputs": [[true], [true], [true], [false], [true], [false], [false]]}
user: Just another day in the world of Minecraft, Steve is getting ready to start his next exciting project -- building a railway system!

![Alt text](http://static.planetminecraft.com/files/resource_media/screenshot/1506/2015-02-02_0156508603066.jpg)

But first, Steve needs to melt some iron ores in the furnace to get the main building blocks of rails -- iron ingots. ![Alt text](http://www.blocksandgold.com/media/catalog/product/cache/3/image/35x/cbcbef48e5e3bcce7c7ed908f20bc5b4/i/r/ironingot_icon32.png)

Each iron ingot takes 11 seconds* to produce. Steve needs a lot of them, and he has the following fuel options to add into the furnace: 

* Buckets of lava, each lasts 800 seconds* ![Alt text](http://www.minecraftguides.org/images/items/bucketL.gif)
* Blaze rod, each lasts 120 seconds ![Alt text](http://www.minecraftguides.org/images/items/blazerod.gif)
* Coals, each lasts 80 seconds ![Alt text](http://www.minecraftguides.org/images/items/coal.gif)
* Blocks of Wood, each lasts 15 seconds ![Alt text](http://www.minecraftguides.org/images/itemGifs/logs.gif)
* Sticks, each lasts 1 second* ![Alt text](http://www.minecraftguides.org/images/items/stick.gif)

In Ruby: 
Write a function `calc_fuel` that calculates the **minimum** amount of fuel needed to produce a certain number of iron ingots. This function should return a hash of the form `{:lava => 2, :blaze_rod => 1, :coal => 1, :wood => 0, :stick => 0}`
In JavaScript:
Write a function `calcFuel` that calculates the **minimum** amount of fuel needed to produce a certain number of iron ingots. This function should return an object of the form `{lava: 2, blazeRod: 1, coal: 1, wood: 0, stick: 0}`
In Python:
Write a function `calc_fuel` that calculates the **minimum** amount of fuel needed to produce a certain number of iron ingots. This function should return a dictionary of the form `{"lava": 2, "blaze rod": 1, "coal": 1, "wood": 0, "stick": 0}`

---
*fictional values

To all the Minecraft players out there: 
feel free to expand this series or let me know if you have any ideas related to Minecraft that can be turned into codewars puzzles. Some ideas I have that might potentially be turned into katas:

* distance traveled in real world vs. in Nether
* shortest path problems related to mining diamonds/gold/goodies that appears in different levels under ground
* growth of animal population from breeding
* redstone stuff?!

If you do end up expanding this series, please send me a link of your kata so I can check it out and include a link to your kata here :-)

* [Minecraft Series #1: Steve wants to build a beacon pyramid](https://www.codewars.com/kata/minecraft-series-number-1-steve-wants-to-build-a-beacon-pyramid/ruby)
* [Minecraft Series #3: Lava is amazing! ](https://www.codewars.com/kata/583a23d40cf946ec380002c2)
* [Minecraft Series #4: Lava is amazing, however...](https://www.codewars.com/kata/583a6b0b171f3a3c3f0003e3)

Answer: {"fn_name": "calc_fuel", "inputs": [[37], [21], [123]], "outputs": [[{"lava": 0, "blaze rod": 3, "coal": 0, "wood": 3, "stick": 2}], [{"lava": 0, "blaze rod": 1, "coal": 1, "wood": 2, "stick": 1}], [{"lava": 1, "blaze rod": 4, "coal": 0, "wood": 4, "stick": 13}]]}
user: One of the first algorithm used for approximating the integer square root of a positive integer `n` is known as "Hero's method", 
named after the first-century Greek mathematician Hero of Alexandria who gave the first description
of the method. Hero's method can be obtained from Newton's method which came 16 centuries after. 

We approximate the square root of a number `n` by taking an initial guess `x`, an error `e` and repeatedly calculating a new approximate *integer* value `x` using: `(x + n / x) / 2`; we are finished when the previous `x` and the `new x` have an absolute difference less than `e`.

We supply to a function (int_rac) a number `n` (positive integer) and a parameter `guess` (positive integer) which will be our initial `x`. For this kata the parameter 'e' is set to `1`.

Hero's algorithm is not always going to come to an exactly correct result! For instance: if n = 25 we get 5 but for n = 26 we also get 5. Nevertheless `5` is the *integer* square root of `26`.

The kata is to return the count of the progression of integer approximations that the algorithm makes.

Reference:



Some examples:
```
int_rac(25,1): follows a progression of [1,13,7,5] so our function should return 4.

int_rac(125348,300): has a progression of [300,358,354] so our function should return 3.

int_rac(125348981764,356243): has a progression of [356243,354053,354046] so our function should return 3.
```

#

You can use Math.floor (or similar) for each integer approximation.
 
#

Note for JavaScript, Coffescript, Typescript:

Don't use the double bitwise NOT ~~ at each iteration if you want to have the same results as in the tests and the other languages.

Answer: {"fn_name": "int_rac", "inputs": [[25, 1], [125348, 300], [125348981764, 356243], [236, 12], [48981764, 8000], [6999, 700], [16000, 400], [16000, 100], [2500, 60], [250000, 600], [95367431640625, 1], [9094947017729282379150390625, 1], [835871232077058, 1], [246391990316004, 1], [403832254158749, 1], [217414278071071, 1], [639593178334873, 1], [646895994940989, 1], [346147532294375, 1], [871397668454373, 1], [711652869429165, 1], [828061341209011, 1]], "outputs": [[4], [3], [3], [2], [3], [6], [5], [3], [2], [3], [28], [52], [30], [29], [29], [29], [29], [29], [29], [30], [29], [30]]}
user: This is the first step to understanding FizzBuzz.  

Your inputs:
a positive integer, n, greater than or equal to one.
n is provided, you have NO CONTROL over its value.

Your expected output is an array of positive integers from 1 to n (inclusive).

Your job is to write an algorithm that gets you from the input to the output.

Answer: {"fn_name": "pre_fizz", "inputs": [[1], [2], [3], [4], [5]], "outputs": [[[1]], [[1, 2]], [[1, 2, 3]], [[1, 2, 3, 4]], [[1, 2, 3, 4, 5]]]}
user: Given a string of characters, I want the function `findMiddle()`/`find_middle()` to return the middle number in the product of each digit in the string.

Example: 's7d8jd9' -> 7, 8, 9 -> 7\*8\*9=504, thus 0 should be returned as an integer.

Not all strings will contain digits. In this case and the case for any non-strings, return -1.

If the product has an even number of digits, return the middle two digits

Example: 1563 -> 56

NOTE: Remove leading zeros if product is even and the first digit of the two is a zero.
Example 2016 -> 1

Answer: {"fn_name": "find_middle", "inputs": [["s7d8jd9"], ["58jd9fgh/fgh6s.,sdf"], ["s7d8jd9dfg4d"], ["s7d8j"], ["asd.fasd.gasdfgsdfgh-sdfghsdfg/asdfga=sdfg"], ["44555"], [null], [[1, 2, 3, 4, 5, 6]], [["a", "b", "c"]], ["5d8jd9fgh/fgh6s.,sdf8sdf9sdf98 3  0"], ["         "], ["e^6*9=#asdfd7-4"], ["s7d8jd9qwertqwrt v654ed1frg651"], ["58"], ["s7d1548jd9dfg4d"], ["s7d54sd6f48j"], ["asd.fasd.gasdfgsdf1gh-sdfghsdfg/asdfga=sdfg"], ["44145s555"], ["sdf496as4df6"], [4554], ["asdf544684868"], ["5d8jd9fgh/fgh64f4f4f00s.,sdf8sdf9sdf98"], ["    s2     "], ["e^6*9=#as5ddfd7-4"], ["s7d8j987d9"], ["58jd9636fgh/fgh6s.,sdf"], ["s7d8j546sdfd9dfg4d"], ["s7d8sdfs165d41fj"], ["asd.fasd.ga654sdfgsdfgh-sdfghsdfg/asdfga=sdfg"], ["4456846955"], [56465462165484], [["a", 1, 2, 3, 4, 5, 6]], [["a", "b", "c", "sfd"]], ["5d8jd9fgh/fgh6s.,6574ssdf8sdf9sdf98 3"], ["     99    "], ["e^6*9984=#asdfd7-4"], ["s7d8js599d9"], ["58jd9fgh654d/fgh6s.,sdf"], ["s7d8jd654sdf9dfg4d"], ["s7asdf68545fd8j"], ["asd.f855dasd.gasdfgsdfgh-sdfghsdfg/asdfga=sdfg"], ["445 2 2 55"], ["nu11"], ["[1,2,3,4,5,6]"], ["[a, b, c, 4, 3]"], ["5d8jd9fgh/fgh6s.,sdf8s5sdf9sdf98 3 "], ["     /./\\    "], ["e^6*9=52d#asdfd7-4"], ["s7564d56d56d8jd9"], ["58jd9fgh/fg97987d9fgh6s.,sdf"]], "outputs": [[0], [16], [1], [56], [-1], [0], [-1], [-1], [-1], [0], [-1], [51], [4], [40], [3], [8], [1], [0], [18], [-1], [8], [0], [2], [56], [40], [32], [19], [72], [2], [36], [-1], [-1], [-1], [5], [81], [54], [41], [92], [19], [88], [0], [0], [1], [2], [12], [6], [-1], [1], [32], [5]]}
user: The most basic encryption method is to map a char to another char by a certain math rule.
Because every char has an ASCII value, we can manipulate this value with a simple math expression. 
For example 'a' + 1 would give us 'b', because 'a' value is 97 and 'b' value is 98.

You will need to write a method which does exactly that - 

get a string as text and an int as the rule of manipulation, and should return encrypted text.
for example:

encrypt("a",1) = "b"

 *Full ascii table is used on our question (256 chars) - so 0-255 are the valid values.*
 
Good luck.

Answer: {"fn_name": "encrypt", "inputs": [["", 1], ["a", 1], ["please encrypt me", 2]], "outputs": [[""], ["b"], ["rngcug\"gpet{rv\"og"]]}
user: The objective is to disambiguate two given names: the original with another

Let's start simple, and just work with plain ascii strings. 

The function ```could_be``` is given the original name and another one to test
against. 

```python
# should return True if the other name could be the same person 
> could_be("Chuck Norris", "Chuck")
True

# should False otherwise (whatever you may personnaly think)
> could_be("Chuck Norris", "superman")
False
``` 

Let's say your name is *Carlos Ray Norris*, your objective is to return True if
the other given name matches any combinaison of the original fullname:

```python
could_be("Carlos Ray Norris", "Carlos Ray Norris") : True
could_be("Carlos Ray Norris", "Carlos Ray") : True
could_be("Carlos Ray Norris", "Norris") : True
could_be("Carlos Ray Norris", "Norris Carlos") : True
```

For the sake of simplicity:

 * the function is case sensitive and accent sensitive for now
 * it is also punctuation sensitive
 * an empty other name should not match any original
 * an empty orginal name should not be matchable
 * the function is not symmetrical

The following matches should therefore fail:

```python
could_be("Carlos Ray Norris", " ") : False
could_be("Carlos Ray Norris", "carlos") : False
could_be("Carlos Ray Norris", "Norris!") : False
could_be("Carlos Ray Norris", "Carlos-Ray Norris") : False
could_be("Ray Norris", "Carlos Ray Norris") : False
could_be("Carlos", "Carlos Ray Norris") : False
```

Too easy ? Try the next steps: 

* [Author Disambiguation: a name is a Name!](https://www.codewars.com/kata/author-disambiguation-a-name-is-a-name)
* or even harder: [Author Disambiguation: Signatures worth it](https://www.codewars.com/kata/author-disambiguation-signatures-worth-it)

Answer: {"fn_name": "could_be", "inputs": [["Carlos Ray Norris", "Carlos Ray Norris"], ["Carlos Ray Norris", "Carlos Ray"], ["Carlos Ray Norris", "Ray Norris"], ["Carlos Ray Norris", "Carlos Norris"], ["Carlos Ray Norris", "Norris"], ["Carlos Ray Norris", "Carlos"], ["Carlos Ray Norris", "Norris Carlos"], ["Carlos Ray Norris", "Carlos Ray Norr"], ["Carlos Ray Norris", "Ra Norris"], ["", "C"], ["", ""], ["Carlos Ray Norris", " "], ["Carlos Ray Norris", "carlos Ray Norris"], ["Carlos", "carlos"], ["Carlos Ray Norris", "Norris!"], ["Carlos Ray Norris", "Carlos-Ray Norris"], ["Carlos Ray", "Carlos Ray Norris"], ["Carlos", "Carlos Ray Norris"]], "outputs": [[true], [true], [true], [true], [true], [true], [true], [false], [false], [false], [false], [false], [false], [false], [false], [false], [false], [false]]}
user: The Padovan sequence is the sequence of integers `P(n)` defined by the initial values

`P(0)=P(1)=P(2)=1`

and the recurrence relation

`P(n)=P(n-2)+P(n-3)`

The first few values of `P(n)` are

`1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 12, 16, 21, 28, 37, 49, 65, 86, 114, 151, 200, 265, ...`

### Task 

The task is to write a method that returns i-th Padovan number

```python
> padovan(0) == 1
> padovan(1) == 1
> padovan(2) == 1
> padovan(n) = padovan(n-2) + padovan(n-3)
```

Answer: {"fn_name": "padovan", "inputs": [[100]], "outputs": [[1177482265857]]}
user: ## Euler's Method

We want to calculate the shape of an unknown curve which starts at a given point 
with a given slope. This curve satisfies an ordinary differential equation (ODE):

```math
\frac{dy}{dx} = f(x, y);\\
y(x_0) = y_0
```

The starting point `$ A_0 (x_0, y_0) $` is known as well as the slope to the curve 
at `$ A_0 $` and then the tangent line at `$ A_0 $` .

Take a small step along that tangent line up to a point `$ A_1 $`. Along this small step, 
the slope does not change too much, so `$ A_1 $` will be close to the curve. 
If we suppose that `$ A_1 $` is close enough to the curve, the same reasoning 
as for the point `$ A_1 $` above can be used for other points. 
After several steps, a polygonal curve `$ A_0, A_1, ..., A_n $` is computed. 
The error between the two curves will be small if the step is small.

We define points `$ A_0, A_1, A_2, ..., A_n $`
whose x-coordinates are `$ x_0, x_1, ..., x_n $`
and y-coordinates are such that `$ y_{k+1} = y_k + f(x_k, y_k) \times h $` 
where `$ h $` is the common step. If `$ T $` is the length `$ x_n - x_0 $` we have `$ h = T/n $`.

## Task

For this kata we will focus on the following differential equation:

```math
\frac{dy}{dx} = 2 - e^{-4x} - 2y; \\
A_0 = (0,1)
```
with `$ x ∈ [0, 1] $`. We will then take a uniform partition of the region of `$ x $` between `$ 0 $` and `$ 1 $` and split it into `$ n $` + 1 sections. `$ n $` will be the input to the function `ex_euler(n)` and since `$ T $` is always 1, `$ h = 1/n $`.

We know that an exact solution is
```math
y = 1 + 0.5e^{-4x} - 0.5e^{-2x}.
```
For each `$ x_k $` we are able to calculate the `$ y_k $` as well as the values `$ z_k $` of the exact solution.

Our task is, for a given number `$ n $` of steps, to return the mean (*truncated* to 6 decimal places)
of the relative errors between the `$ y_k $` (our aproximation) and the `$ z_k $` (the exact solution). 
For that we can use:

error in `$ A_k = abs(y_k - z_k) / z_k $` and then the mean is sum(errors in `$ A_k $`)/ (`$ n $` + 1)

## Examples

```python
ex_euler(10) should return: 0.026314 (truncated from 0.026314433214799246)
with
Y = [1.0,0.9..., 0.85..., 0.83..., 0.83..., 0.85..., 0.86..., 0.88..., 0.90..., 0.91..., 0.93...]
Z = [1.0, 0.9..., 0.88..., 0.87..., 0.87..., 0.88..., 0.89..., 0.90..., 0.91..., 0.93..., 0.94...]
Relative errors = [0.0, 0.02..., 0.04..., 0.04..., 0.04..., 0.03..., 0.03..., 0.02..., 0.01..., 0.01..., 0.01...]
```
`ex_euler(17)` should return: `0.015193 (truncated from 0.015193336263370796)`.
As expected, as `$ n $` increases, our error reduces.
### Links and graphs

Wiki article

![alternative text](http://i.imgur.com/vjK7edl.png)

Below comparison between approximation (red curve) and exact solution(blue curve) for n=100:
![alternative text](http://i.imgur.com/KufSkYEm.png)

Answer: {"fn_name": "ex_euler", "inputs": [[1], [10], [17], [50], [100], [200], [400], [800], [1000], [1200], [1500], [2000]], "outputs": [[0.5], [0.026314], [0.015193], [0.005073], [0.002524], [0.001259], [0.000628], [0.000314], [0.000251], [0.000209], [0.000167], [0.000125]]}
user: ## Problem

Determine whether a positive integer number is **colorful** or not.

`263` is a colorful number because `[2, 6, 3, 2*6, 6*3, 2*6*3]` are all different; whereas `236` is not colorful, because `[2, 3, 6, 2*3, 3*6, 2*3*6]` have `6` twice.

So take all consecutive subsets of digits, take their product and ensure all the products are different.

## Examples
```pyhton
263  -->  true
236  -->  false
```

Answer: {"fn_name": "colorful", "inputs": [[5], [23], [263], [235789], [50], [13], [236], [2357893]], "outputs": [[true], [true], [true], [true], [false], [false], [false], [false]]}