meetforever/GRPO_CL huggingface dataset:
user: Mr. E Ven only likes even length words.
Please create a translator so that he doesn't have to hear those pesky odd length words.
For some reason he also hates punctuation, he likes his sentences to flow.

Your translator should take in a string and output it with all odd length words having an extra letter (the last letter in the word). It should also remove all punctuation (.,?!) as well as any underscores (_).

"How did we end up here? We go?"
translated becomes-> 
"Howw didd we endd up here We go"

Answer: {"fn_name": "evenator", "inputs": [["I got a hole in 1!"], ["tHiS sEnTeNcE iS eVeN."], ["underscore is not considered a word..in this case,"], ["hi. how are you? Bye!!"], ["lorem is so ipsum. why bother?"], ["_under the seA!"]], "outputs": [["II gott aa hole in 11"], ["tHiS sEnTeNcE iS eVeN"], ["underscore is nott considered aa wordin this case"], ["hi howw aree youu Byee"], ["loremm is so ipsumm whyy bother"], ["underr thee seAA"]]}
user: Create a function with two arguments that will return an array of the first (n) multiples of (x). 

Assume both the given number and the number of times to count will be positive numbers greater than 0. 

Return the results as an array (or list in Python, Haskell or Elixir).

Examples:

```python
count_by(1,10) #should return [1,2,3,4,5,6,7,8,9,10]
count_by(2,5) #should return [2,4,6,8,10]
```

Answer: {"fn_name": "count_by", "inputs": [[1, 5], [2, 5], [3, 5], [50, 5], [100, 5]], "outputs": [[[1, 2, 3, 4, 5]], [[2, 4, 6, 8, 10]], [[3, 6, 9, 12, 15]], [[50, 100, 150, 200, 250]], [[100, 200, 300, 400, 500]]]}
user: In mathematics, a **pandigital number** is a number that in a given base has among its significant digits each digit used in the base at least once. For example, 1234567890 is a pandigital number in base 10.

For simplification, in this kata, we will consider pandigital numbers in *base 10* and with all digits used *exactly once*. The challenge is to calculate a sorted sequence of pandigital numbers, starting at a certain `offset` and with a specified `size`.

Example:
```python
  > get_sequence(0, 5)
  [1023456789, 1023456798, 1023456879, 1023456897, 1023456978]
```

Rules:
- We are looking for positive pandigital numbers in base 10.
- Each digit should occur `exactly once`.
- A pandigital number can't start with digit zero.
- The offset is an integer (negative, zero or positive number) (long in Java)
- The size is a positive integer number (int in Java)
- Return the `size` pandigital numbers which are not smaller than the `offset`. If there is not enough `size` pandigital numbers, just return all of them.
- Return an empty array if nothing is found.

Answer: {"fn_name": "get_sequence", "inputs": [[0, 5], [5432160879, 3], [9876543000, 5], [9999999999, 1], [-123456789, 1], [-9999999999, 25]], "outputs": [[[1023456789, 1023456798, 1023456879, 1023456897, 1023456978]], [[5432160879, 5432160897, 5432160978]], [[9876543012, 9876543021, 9876543102, 9876543120, 9876543201]], [[]], [[1023456789]], [[1023456789, 1023456798, 1023456879, 1023456897, 1023456978, 1023456987, 1023457689, 1023457698, 1023457869, 1023457896, 1023457968, 1023457986, 1023458679, 1023458697, 1023458769, 1023458796, 1023458967, 1023458976, 1023459678, 1023459687, 1023459768, 1023459786, 1023459867, 1023459876, 1023465789]]]}
user: Write a function to split a string and convert it into an array of words. For example:

```python
"Robin Singh" ==> ["Robin", "Singh"]

"I love arrays they are my favorite" ==> ["I", "love", "arrays", "they", "are", "my", "favorite"]
```

Answer: {"fn_name": "string_to_array", "inputs": [["Robin Singh"], ["CodeWars"], ["I love arrays they are my favorite"], ["1 2 3"], [""]], "outputs": [[["Robin", "Singh"]], [["CodeWars"]], [["I", "love", "arrays", "they", "are", "my", "favorite"]], [["1", "2", "3"]], [[""]]]}
user: Bob is preparing to pass IQ test. The most frequent task in this test is `to find out which one of the given numbers differs from the others`. Bob observed that one number usually differs from the others in **evenness**. Help Bob — to check his answers, he needs a program that among the given numbers finds one that is different in evenness, and return a position of this number.

`!` Keep in mind that your task is to help Bob solve a `real IQ test`, which means indexes of the elements start from `1 (not 0)`

##Examples :

 
```python
iq_test("2 4 7 8 10") => 3 // Third number is odd, while the rest of the numbers are even

iq_test("1 2 1 1") => 2 // Second number is even, while the rest of the numbers are odd
```

Answer: {"fn_name": "iq_test", "inputs": [["2 4 7 8 10"], ["1 2 2"], ["88 96 66 51 14 88 2 92 18 72 18 88 20 30 4 82 90 100 24 46"], ["100 99 100"], ["5 3 2"], ["43 28 1 91"], ["20 94 56 50 10 98 52 32 14 22 24 60 4 8 98 46 34 68 82 82 98 90 50 20 78 49 52 94 64 36"], ["79 27 77 57 37 45 27 49 65 33 57 21 71 19 75 85 65 61 23 97 85 9 23 1 9 3 99 77 77 21 79 69 15 37 15 7 93 81 13 89 91 31 45 93 15 97 55 80 85 83"], ["100 100 1"], ["9 31 27 93 17 77 75 9 9 53 89 39 51 99 5 1 11 39 27 49 91 17 27 79 81 71 37 75 35 13 93 4 99 55 85 11 23 57 5 43 5 61 15 35 23 91 3 81 99 85 43 37 39 27 5 67 7 33 75 59 13 71 51 27 15 93 51 63 91 53 43 99 25 47 17 71 81 15 53 31 59 83 41 23 73 25 91 9"]], "outputs": [[3], [1], [4], [2], [3], [2], [26], [48], [3], [32]]}
user: # Task
 Mr.Nam has `n` candies, he wants to put one candy in each cell of a table-box. The table-box has `r` rows and `c` columns.

 Each candy was labeled by its cell number. The cell numbers are in range from 1 to N and the direction begins from right to left and from bottom to top.

 Nam wants to know the position of a specific `candy` and which box is holding it.

 The result should be an array and contain exactly 3 elements. The first element is the `label` of the table; The second element is the `row` of the candy; The third element is the `column` of the candy.
 
 If there is no candy with the given number, return `[-1, -1, -1]`.

 Note: 
 
 When the current box is filled up, Nam buys another one. 
 
 The boxes are labeled from `1`.

 Rows and columns are `0`-based numbered from left to right and from top to bottom.
 
# Example

 For `n=6,r=2,c=2,candy=3`, the result should be `[1,0,1]`
 
 the candies will be allocated like this:
```
Box 1
+-----+-----+
|  4  | (3) | --> box 1,row 0, col 1
+-----+-----+
|  2  |  1  |
+-----+-----+
Box 2
+-----+-----+
|  x  |  x  |
+-----+-----+
|  6  | (5) | --> box 2,row 1, col 1
+-----+-----+```
 For `candy = 5(n,r,c same as above)`, the output should be `[2,1,1]`.
 
 For `candy = 7(n,r,c same as above)`, the output should be `[-1,-1,-1]`.
 
 For `n=8,r=4,c=2,candy=3`, the result should be `[1,2,1]` 
```
Box 1
+-----+-----+
|  8  |  7  |
+-----+-----+
|  6  |  5  |
+-----+-----+
|  4  | (3) |--> box 1,row 2, col 1
+-----+-----+
|  2  |  1  |
+-----+-----+
```

# Input/Output


 - `[input]` integer `n`

  The number of candies. 
  
  `0 < n <= 100`


 - `[input]` integer `r`

  The number of rows. 
  
  `0 < r <= 100`


 - `[input]` integer `c`

 The number of columns.

 `0 < c <= 100`


 - `[input]` integer `candy`

 The label of the candy Nam wants to get position of.
 
 `0 < c <= 120`

 - `[output]` an integer array

  Array of 3 elements: a label, a row and a column.

Answer: {"fn_name": "get_candy_position", "inputs": [[6, 2, 2, 3], [6, 2, 2, 5], [6, 2, 2, 7], [8, 4, 2, 3], [15, 3, 3, 1], [15, 3, 3, 5], [15, 3, 3, 7], [15, 3, 3, 14], [15, 3, 3, 18]], "outputs": [[[1, 0, 1]], [[2, 1, 1]], [[-1, -1, -1]], [[1, 2, 1]], [[1, 2, 2]], [[1, 1, 1]], [[1, 0, 2]], [[2, 1, 1]], [[-1, -1, -1]]]}
user: I love Fibonacci numbers in general, but I must admit I love some more than others. 

I would like for you to write me a function that when given a number (n)  returns the n-th number in the Fibonacci Sequence.

For example:

```python
   nth_fib(4) == 2
```

Because 2 is the 4th number in the Fibonacci Sequence.

For reference, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two.

Answer: {"fn_name": "nth_fib", "inputs": [[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24], [25]], "outputs": [[0], [1], [1], [2], [3], [5], [8], [13], [21], [34], [55], [89], [144], [233], [377], [610], [987], [1597], [2584], [4181], [6765], [10946], [17711], [28657], [46368]]}
user: The magic sum of 3s is calculated on an array by summing up odd numbers which include the digit `3`. Write a function `magic_sum` which accepts an array of integers and returns the sum.

*Example:* `[3, 12, 5, 8, 30, 13]` results in `16` (`3` + `13`)

If the sum cannot be calculated, `0` should be returned.

Answer: {"fn_name": "magic_sum", "inputs": [[[3]], [[3, 13]], [[30, 34, 330]], [[3, 12, 5, 8, 30, 13]], [[]], [null]], "outputs": [[3], [16], [0], [16], [0], [0]]}
user: # Scenario 

*You're saying good-bye your best friend* , **_See you next happy year_** . 

**_Happy Year_** *is the year with only distinct digits* , (e.g) **_2018_**

___
# Task

**_Given_** a year, **_Find_** **_The next happy year_** or **_The closest year You'll see your best friend_**      ![!alt](https://i.imgur.com/mdX8dJP.png) ![!alt](https://i.imgur.com/mdX8dJP.png)

___
# Notes

* **_Year_** Of Course always **_Positive_** .
* **_Have no fear_** , *It is guaranteed that the answer exists* . 
* **_It's not necessary_** *that the year passed to the function is Happy one* .   
* **_Input Year with in range_** *(1000  ≤  y  ≤  9000)*

____
# Input >> Output Examples:

```
nextHappyYear (7712) ==> return (7801)
```

## **_Explanation_**:

As the **_Next closest year with only distinct digits is_**  *7801* . 
___

```
nextHappyYear (8989) ==> return (9012)
```

## **_Explanation_**:

As the **_Next closest year with only distinct digits is_**  *9012* . 
___

```
nextHappyYear (1001) ==> return (1023)
```

## **_Explanation_**:

As the **_Next closest year with only distinct digits is_**  *1023* .
___
___
___

# [Playing with Numbers Series](https://www.codewars.com/collections/playing-with-numbers)

# [Playing With Lists/Arrays Series](https://www.codewars.com/collections/playing-with-lists-slash-arrays)

# [For More Enjoyable Katas](http://www.codewars.com/users/MrZizoScream/authored)
___

## ALL translations are welcomed

## Enjoy Learning !!
# Zizou

Answer: {"fn_name": "next_happy_year", "inputs": [[1001], [1123], [2001], [2334], [3331], [1987], [5555], [7712], [8088], [8999]], "outputs": [[1023], [1203], [2013], [2340], [3401], [2013], [5601], [7801], [8091], [9012]]}
user: #Permutation  position
In this kata you will have to permutate through a string of lowercase letters, each permutation will start at ```a``` and you must calculate how many iterations it takes to reach the current permutation.

##examples
```
input: 'a'
result: 1

input: 'c'
result: 3

input: 'z'
result: 26

input: 'foo'
result: 3759

input: 'aba'
result: 27

input: 'abb'
result: 28

```

Answer: {"fn_name": "permutation_position", "inputs": [["a"], ["z"], ["aaa"], ["aaab"], ["foo"]], "outputs": [[1], [26], [1], [2], [3759]]}
user: # Task
 Given a rectangular `matrix` and integers `a` and `b`, consider the union of the ath row and the bth (both 0-based) column of the `matrix`. Return sum of all elements of that union.

# Example

 For
```
matrix = [[1, 1, 1, 1], 
          [2, 2, 2, 2], 
          [3, 3, 3, 3]]
a = 1 and b = 3 ```
the output should be `12`.

 Here `(2 + 2 + 2 + 2) + (1 + 3) = 12`.

# Input/Output


 - `[input]` 2D integer array `matrix`

    2-dimensional array of integers representing a rectangular matrix.

    Constraints: `1 ≤ matrix.length ≤ 5, 1 ≤ matrix[0].length ≤ 5, 1 ≤ matrix[i][j] ≤ 100.`
    

 - `[input]` integer `a`

  A non-negative integer less than the number of matrix rows.

   Constraints: `0 ≤ a < matrix.length.`
   
   
 - `[input]` integer `b`

   A non-negative integer less than the number of matrix columns.

   Constraints: `0 ≤ b < matrix[i].length. `


 - `[output]` an integer

Answer: {"fn_name": "crossing_sum", "inputs": [[[[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]], 1, 3], [[[1, 1], [3, 3], [1, 1], [2, 2]], 3, 0], [[[100]], 0, 0], [[[1, 2, 3, 4, 5]], 0, 0], [[[1], [2], [3], [4], [5]], 0, 0]], "outputs": [[12], [9], [100], [15], [15]]}
user: Given an array of numbers, return the difference between the largest and smallest values. 

For example:

`[23, 3, 19, 21, 16]` should return `20` (i.e., `23 - 3`).

`[1, 434, 555, 34, 112]` should return `554` (i.e., `555 - 1`).

The array will contain a minimum of two elements. Input data range guarantees that `max-min` will cause no integer overflow.

Answer: {"fn_name": "between_extremes", "inputs": [[[1, 1]], [[-1, -1]], [[1, -1]], [[21, 34, 54, 43, 26, 12]], [[-1, -41, -77, -100]]], "outputs": [[0], [0], [2], [42], [99]]}
user: We have the following recursive function:



The 15-th term; ```f(14)``` is the first term in having more that 100 digits.

In fact, 
```
f(14) = 2596253046576879973769082409566059879570061514363339324718953988724415850732046186170181072783243503881471037546575506836249417271830960970629933033088

It has 151 digits.
```
Make the function ```something_acci()```, that receives ```num_dig``` (number of digits of the value) as unique argument.

```something_acci()``` will output a tuple/array with the ordinal number in the sequence for the least value in having equal or more than the given number of digits.

Let's see some cases:
```python
something_acci(20) == (12, 25)
# f(11) = 1422313222839141753028416

something_acci(100) == (15, 151)
```
The number of digits given will be always more than 5. ```num_dig > 5```.

Happy coding!!!

And the name for this kata? You have three words of the same meaning in Asian Languages.

Answer: {"fn_name": "something_acci", "inputs": [[5], [10], [20], [100]], "outputs": [[[10, 8]], [[11, 14]], [[12, 25]], [[15, 151]]]}
user: Error Handling is very important in coding and seems to be overlooked or not implemented properly.

#Task

Your task is to implement a function which takes a string as input and return an object containing the properties
vowels and consonants. The vowels property must contain the total count of vowels {a,e,i,o,u}, and the total count of consonants {a,..,z} - {a,e,i,o,u}. Handle invalid input and don't forget to return valid ones.

#Input

The input is any random string. You must then discern what are vowels and what are consonants and sum for each category their total occurrences in an object. However you could also receive inputs that are not strings. If this happens then you must return an object with a vowels and consonants total of 0 because the input was NOT a string. Refer to the Example section for a more visual representation of which inputs you could receive and the outputs expected. :)

Example:

```python
Input: get_count('test')
Output: {vowels:1,consonants:3}

Input: get_count('tEst')
Output: {vowels:1,consonants:3}

Input get_count('    ')
Output: {vowels:0,consonants:0}

Input get_count()
Output: {vowels:0,consonants:0}
```

C#

A Counter class has been put in the preloaded section taking two parameters Vowels and Consonants this must be the Object you return!

Answer: {"fn_name": "get_count", "inputs": [["Test"], ["Here is some text"], ["To be a Codewarrior or not to be"], ["To Kata or not to Kata"], ["aeiou"], ["TEst"], ["HEre Is sOme text"], [["To Kata or not to Kata"]], [null], ["Test               "], ["Here is some text  "], ["                         "], [{"jjjjj": "jjjjj"}]], "outputs": [[{"vowels": 1, "consonants": 3}], [{"vowels": 6, "consonants": 8}], [{"vowels": 12, "consonants": 13}], [{"vowels": 8, "consonants": 9}], [{"vowels": 5, "consonants": 0}], [{"vowels": 1, "consonants": 3}], [{"vowels": 6, "consonants": 8}], [{"vowels": 0, "consonants": 0}], [{"vowels": 0, "consonants": 0}], [{"vowels": 1, "consonants": 3}], [{"vowels": 6, "consonants": 8}], [{"vowels": 0, "consonants": 0}], [{"vowels": 0, "consonants": 0}]]}
user: The new football league season is coming and the Football Association need some help resetting the league standings. Normally the initial league standing is done in alphabetical order (from A to Z) but this year the FA have decided to freshen it up. 

It has been decided that team who finished first last season will begin the next season in first place. Regardless of what letter their club begins with. e.g. if Manchester City were in first place last year, they will begin the season in position one. All other teams should be in alphabetical order. 

The teams will be fed in as an object ({}). The key will be will be their position from last season and the value is the club's name e.g. Arsenal. 

The output should be an object ({}) with the key as the club's starting position for the new season and the value should be club's name e.g. Arsenal.

For example. If in the previous season the standings were:

1:'Leeds United'
2:'Liverpool'
3:'Manchester City'
4:'Coventry'
5:'Arsenal' 

Then the new season standings should 

1:'Leeds United' (first last season)
2:'Arsenal' (alphabetical)
3:'Coventry' (alphabetical) 
4:'Liverpool' (alphabetical) 
5:'Manchester City' (alphabetical)

Answer: {"fn_name": "premier_league_standings", "inputs": [[{"1": "Arsenal"}], [{"2": "Arsenal", "3": "Accrington Stanley", "1": "Leeds United"}], [{"1": "Leeds United", "2": "Liverpool", "3": "Manchester City", "4": "Coventry", "5": "Arsenal"}]], "outputs": [{"1": "Arsenal"}, {"3": "Arsenal", "2": "Accrington Stanley", "1": "Leeds United"}, {"1": "Leeds United", "2": "Arsenal", "3": "Coventry", "4": "Liverpool", "5": "Manchester City"}]}
user: Your task is to write a function that does just what the title suggests (so, fair warning, be aware that you are not getting out of it just throwing a lame bas sorting method there) with an array/list/vector of integers and the expected number `n` of smallest elements to return.

Also:

* the number of elements to be returned cannot be higher than the array/list/vector length;
* elements can be duplicated;
* in case of duplicates, just return them according to the original order (see third example for more clarity).

Same examples and more in the test cases:

```python
first_n_smallest([1,2,3,4,5],3) == [1,2,3]
first_n_smallest([5,4,3,2,1],3) == [3,2,1]
first_n_smallest([1,2,3,4,1],3) == [1,2,1]
first_n_smallest([1,2,3,-4,0],3) == [1,-4,0]
first_n_smallest([1,2,3,4,5],0) == []
```

[Performance version by FArekkusu](https://www.codewars.com/kata/5aeed69804a92621a7000077) also available.

Answer: {"fn_name": "first_n_smallest", "inputs": [[[1, 2, 3, 4, 5], 3], [[5, 4, 3, 2, 1], 3], [[1, 2, 3, 1, 2], 3], [[1, 2, 3, -4, 0], 3], [[1, 2, 3, 4, 5], 0], [[1, 2, 3, 4, 5], 5], [[1, 2, 3, 4, 2], 4], [[2, 1, 2, 3, 4, 2], 2], [[2, 1, 2, 3, 4, 2], 3], [[2, 1, 2, 3, 4, 2], 4]], "outputs": [[[1, 2, 3]], [[3, 2, 1]], [[1, 2, 1]], [[1, -4, 0]], [[]], [[1, 2, 3, 4, 5]], [[1, 2, 3, 2]], [[2, 1]], [[2, 1, 2]], [[2, 1, 2, 2]]]}
user: This is a follow up from my kata The old switcheroo

Write
```python
def encode(str)
```
that takes in a string ```str``` and replaces all the letters with their respective positions in the English alphabet.

```python
encode('abc') == '123'   # a is 1st in English alpabet, b is 2nd and c is 3rd
encode('codewars') == '315452311819'
encode('abc-#@5') == '123-#@5'
```
String are case sensitive.

Answer: {"fn_name": "encode", "inputs": [["abc"], ["ABCD"], ["ZzzzZ"], ["abc-#@5"], ["this is a long string!! Please [encode] @C0RrEctly"]], "outputs": [["123"], ["1234"], ["2626262626"], ["123-#@5"], ["208919 919 1 1215147 1920189147!! 161251195 [51431545] @30181853201225"]]}
user: Is every value in the array an array?

This should only test the second array dimension of the array. The values of the nested arrays don't have to be arrays. 

Examples:

```python
[[1],[2]] => true
['1','2'] => false
[{1:1},{2:2}] => false
```

Answer: {"fn_name": "arr_check", "inputs": [[[]], [[["string"]]], [[[], {}]], [[[1], [2], [3]]], [["A", "R", "R", "A", "Y"]]], "outputs": [[true], [true], [false], [true], [false]]}
user: Baby is getting his frst tooth. This means more sleepless nights, but with the fun of feeling round his gums and trying to guess which will be first out! 

Probably best have a sweepstake with your friends - because you have the best chance of knowing. You can feel the gums and see where the raised bits are - most raised, most likely tooth to come through first!

Given an array of numbers (t) to represent baby's gums, you need to return the index of the lump that is most pronounced. 

The most pronounced lump is the one that has the biggest differential to its surrounding values. e.g.:

```
[1, 2, 4] = 2

index 0 has a differential of -1 to its right (it is lower so the figure is negative)

index 1 has a differential of +1 to its left, and -2 to its right. Total is -1.

index 2 has a differential of +2 to its left, and nothing to its right, 
```

If there is no distinct highest value (more than one occurence of the largest differential), return -1.

Answer: {"fn_name": "first_tooth", "inputs": [[[1, 2, 3, 4]], [[1, 2, 6, 4]], [[1, 2, 5, 7, 1, 0, 9]], [[9, 2, 8, 1]], [[1, 1, 1, 1]], [[20, 9, 16, 19]], [[15]]], "outputs": [[3], [2], [6], [2], [-1], [0], [0]]}
user: A series or sequence of numbers is usually the product of a function and can either be infinite or finite.

In this kata we will only consider finite series and you are required to return a code according to the type of sequence:

|Code|Type|Example|
|-|-|-|
|`0`|`unordered`|`[3,5,8,1,14,3]`|
|`1`|`strictly increasing`|`[3,5,8,9,14,23]`|
|`2`|`not decreasing`|`[3,5,8,8,14,14]`|
|`3`|`strictly decreasing`|`[14,9,8,5,3,1]`|
|`4`|`not increasing`|`[14,14,8,8,5,3]`|
|`5`|`constant`|`[8,8,8,8,8,8]`|

You can expect all the inputs to be non-empty and completely numerical arrays/lists - no need to validate the data; do not go for sloppy code, as rather large inputs might be tested.

Try to achieve a good solution that runs in linear time; also, do it functionally, meaning you need to build a *pure* function or, in even poorer words, do NOT modify the initial input!

Answer: {"fn_name": "sequence_classifier", "inputs": [[[3, 5, 8, 1, 14, 3]], [[3, 5, 8, 9, 14, 23]], [[3, 5, 8, 8, 14, 14]], [[14, 9, 8, 5, 3, 1]], [[14, 14, 8, 8, 5, 3]], [[8, 8, 8, 8, 8, 8]], [[8, 9]], [[8, 8, 8, 8, 8, 9]], [[9, 8]], [[9, 9, 9, 8, 8, 8]], [[3, 5, 8, 1, 14, 2]]], "outputs": [[0], [1], [2], [3], [4], [5], [1], [2], [3], [4], [0]]}
user: This challenge is based on [the kata](https://www.codewars.com/kata/n-smallest-elements-in-original-order) by GiacomoSorbi. Before doing this one it is advisable to complete the non-performance version first.

___

# Task

You will be given an array of random integers and a number `n`. You have to extract `n` smallest integers out of it **preserving the original order**.

# Examples

```python
performant_smallest([1, 2, 3, 4, 5], 3)     ==   [1, 2, 3]
performant_smallest([5, 4, 3, 2, 1], 3)     ==   [3, 2, 1]
performant_smallest([1, 2, 3, 4, 1], 3)     ==   [1, 2, 1]
performant_smallest([2, 1, 3, 2, 3], 3)     ==   [2, 1, 2]
```

# Notes

* There will be duplicates in the array, and they have to be returned in the order of their each separate appearence.
* This kata is an example of the "know your data" principle. Remember this while searching for the correct approach.

# Performance tests

```python
Tests: 15
Array size: 800,000
Values range: [1; 50]
Number of elements to return: 25-50% of the array
```

Answer: {"fn_name": "performant_smallest", "inputs": [[[1, 2, 3, 4, 5], 3], [[5, 4, 3, 2, 1], 3], [[1, 2, 3, 4, 1], 3], [[2, 1, 3, 2, 3], 3]], "outputs": [[[1, 2, 3]], [[3, 2, 1]], [[1, 2, 1]], [[2, 1, 2]]]}