meetforever/GRPO_CL huggingface dataset:
user: In this kata, you should calculate type of triangle with three given sides ``a``, ``b`` and ``c`` (given in any order).

If all angles are less than ``90°``, this triangle is ``acute`` and function should return ``1``.

If one angle is strictly ``90°``, this triangle is ``right`` and function should return ``2``.

If one angle more than ``90°``, this triangle is ``obtuse`` and function should return ``3``.

If three sides cannot form triangle, or one angle is ``180°`` (which turns triangle into segment) - function should return ``0``.

Input parameters are ``sides`` of given triangle. All input values are non-negative floating point or integer numbers (or both).




Acute


Right


Obtuse




### Examples:
```python
triangle_type(2, 4, 6) # return 0 (Not triangle)
triangle_type(8, 5, 7) # return 1 (Acute, angles are approx. 82°, 38° and 60°)
triangle_type(3, 4, 5) # return 2 (Right, angles are approx. 37°, 53° and exactly 90°)
triangle_type(7, 12, 8) # return 3 (Obtuse, angles are approx. 34°, 106° and 40°)
```

If you stuck, this can help you: http://en.wikipedia.org/wiki/Law_of_cosines. But you can solve this kata even without angle calculation.

There is very small chance of random test to fail due to round-off error, in such case resubmit your solution.

Answer: {"fn_name": "triangle_type", "inputs": [[1, 2, 3], [5.5, 4.5, 10], [7, 3, 2], [5, 10, 5], [3, 3, 0], [3, 3, 1], [5, 5, 5], [122.14, 222.11, 250], [8, 5, 7], [100000, 100005, 111111], [3, 4, 5], [21, 220, 221], [8.625, 33.625, 32.5], [65, 56, 33], [68000, 285000, 293000], [2, 4, 5], [105, 100, 6], [102, 200, 250], [65, 55, 33], [7, 8, 12], [7.99999, 4, 4]], "outputs": [[0], [0], [0], [0], [0], [1], [1], [1], [1], [1], [2], [2], [2], [2], [2], [3], [3], [3], [3], [3], [3]]}
user: Given a list of integers, return the nth smallest integer in the list. **Only distinct elements should be considered** when calculating the answer. `n` will always be positive (`n > 0`)

If the nth small integer doesn't exist, return `-1` (C++) / `None` (Python) / `nil` (Ruby) / `null` (JavaScript).

Notes:
* "indexing" starts from 1
* huge lists (of 1 million elements) will be tested

## Examples

```python
nth_smallest([1, 3, 4, 5], 7)        ==> None  # n is more than the size of the list
nth_smallest([4, 3, 4, 5], 4)        ==> None  # 4th smallest integer doesn't exist
nth_smallest([45, -10, 4, 5, 4], 4)  ==> 45    # 4th smallest integer is 45
```

If you get a timeout, just try to resubmit your solution. However, if you ***always*** get a timeout, review your code.

Answer: {"fn_name": "nth_smallest", "inputs": [[[14, 12, 46, 34, 334], 3], [[4000], 1], [[14, 12, 46, 0, 334], 1]], "outputs": [[34], [4000], [0]]}
user: Create a combat function that takes the player's current health and the amount of damage recieved, and returns the player's new health.
Health can't be less than 0.

Answer: {"fn_name": "combat", "inputs": [[100, 5], [83, 16], [20, 30]], "outputs": [[95], [67], [0]]}
user: It started as a discussion with a friend, who didn't fully grasp some way of setting defaults, but I thought the idea was cool enough for a beginner kata: binary `OR` each matching element of two given arrays (or lists, if you do it in Python; vectors in c++) of integers and give the resulting ORed array [starts to sound like a tonguetwister, doesn't it?].

If one array is shorter than the other, use the optional third parametero (defaulted to `0`) to `OR` the unmatched elements.

For example:

```python
or_arrays([1,2,3],[1,2,3]) == [1,2,3]
or_arrays([1,2,3],[4,5,6]) == [5,7,7]
or_arrays([1,2,3],[1,2]) == [1,2,3]
or_arrays([1,2],[1,2,3]) == [1,2,3]
or_arrays([1,2,3],[1,2,3],3) == [1,2,3]
```

Answer: {"fn_name": "or_arrays", "inputs": [[[1, 2, 3], [1, 2, 3]], [[1, 2, 3], [4, 5, 6]], [[1, 2, 3], [1, 2]], [[1, 0], [1, 2, 3]], [[1, 0, 3], [1, 2, 3], 3]], "outputs": [[[1, 2, 3]], [[5, 7, 7]], [[1, 2, 3]], [[1, 2, 3]], [[1, 2, 3]]]}
user: "The Shell Game" involves cups upturned on a playing surface, with a ball placed underneath one of them.  The index of the cups are swapped around multiple times. After that the players will try to find which cup contains the ball.

Your task is as follows.  Given the cup that the ball starts under, and list of swaps, return the location of the ball at the end.  Cups are given like array/list indices.

For example, given the starting position `0` and the swaps `[(0, 1), (1, 2), (1, 0)]`:

 * The first swap moves the ball from `0` to `1`
 * The second swap moves the ball from `1` to `2`
 * The final swap doesn't affect the position of the ball.
 
 So

```python
find_the_ball(0, [(0, 1), (2, 1), (0, 1)]) == 2
```

There aren't necessarily only three cups in this game, but there will be at least two.  You can assume all swaps are valid, and involve two distinct indices.

Answer: {"fn_name": "find_the_ball", "inputs": [[5, []], [0, []], [9, []], [0, [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], [15, 16], [16, 17], [17, 18], [18, 19], [19, 20], [20, 21], [21, 22], [22, 23], [23, 24], [24, 25], [25, 26], [26, 27], [27, 28], [28, 29], [29, 30], [30, 31], [31, 32], [32, 33], [33, 34], [34, 35], [35, 36], [36, 37], [37, 38], [38, 39], [39, 40], [40, 41], [41, 42], [42, 43], [43, 44], [44, 45], [45, 46], [46, 47], [47, 48], [48, 49], [49, 50], [50, 51], [51, 52], [52, 53], [53, 54], [54, 55], [55, 56], [56, 57], [57, 58], [58, 59], [59, 60], [60, 61], [61, 62], [62, 63], [63, 64], [64, 65], [65, 66], [66, 67], [67, 68], [68, 69], [69, 70], [70, 71], [71, 72], [72, 73], [73, 74], [74, 75], [75, 76], [76, 77], [77, 78], [78, 79], [79, 80], [80, 81], [81, 82], [82, 83], [83, 84], [84, 85], [85, 86], [86, 87], [87, 88], [88, 89], [89, 90], [90, 91], [91, 92], [92, 93], [93, 94], [94, 95], [95, 96], [96, 97], [97, 98], [98, 99], [99, 100], [100, 101]]], [0, [[1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [17, 16], [18, 17], [19, 18], [20, 19], [21, 20], [22, 21], [23, 22], [24, 23], [25, 24], [26, 25], [27, 26], [28, 27], [29, 28], [30, 29], [31, 30], [32, 31], [33, 32], [34, 33], [35, 34], [36, 35], [37, 36], [38, 37], [39, 38], [40, 39], [41, 40], [42, 41], [43, 42], [44, 43], [45, 44], [46, 45], [47, 46], [48, 47], [49, 48], [50, 49], [51, 50], [52, 51], [53, 52], [54, 53], [55, 54], [56, 55], [57, 56], [58, 57], [59, 58], [60, 59], [61, 60], [62, 61], [63, 62], [64, 63], [65, 64], [66, 65], [67, 66], [68, 67], [69, 68], [70, 69], [71, 70], [72, 71], [73, 72], [74, 73], [75, 74], [76, 75], [77, 76], [78, 77], [79, 78], [80, 79], [81, 80], [82, 81], [83, 82], [84, 83], [85, 84], [86, 85], [87, 86], [88, 87], [89, 88], [90, 89], [91, 90], [92, 91], [93, 92], [94, 93], [95, 94], [96, 95], [97, 96], [98, 97], [99, 98], [100, 99], [101, 100]]]], "outputs": [[5], [0], [9], [101], [101]]}
user: # Task
 Pero has been into robotics recently, so he decided to make a robot that checks whether a deck of poker cards is complete.

 He’s already done a fair share of work - he wrote a programme that recognizes the suits of the cards. For simplicity’s sake, we can assume that all cards have a suit and a number.

 The suit of the card is one of the characters `"P", "K", "H", "T"`, and the number of the card is an integer between `1` and `13`. The robot labels each card in the format `TXY` where `T` is the suit and `XY` is the number. If the card’s number consists of one digit, then X = 0. For example, the card of suit `"P"` and number `9` is labelled `"P09"`.

 A complete deck has `52` cards in total. For each of the four suits there is exactly one card with a number between `1` and `13`.

 The robot has read the labels of all the cards in the deck and combined them into the string `s`.
 
 Your task is to help Pero finish the robot by writing a program that reads the string made out of card labels and returns the number of cards that are missing for each suit.

 If there are two same cards in the deck, return array with `[-1, -1, -1, -1]` instead.

# Input/Output


 - `[input]` string `s`

  A correct string of card labels. 0 ≤ |S| ≤ 1000


 - `[output]` an integer array

  Array of four elements, representing the number of missing card of suits `"P", "K", "H", and "T"` respectively. If there are two same cards in the deck, return `[-1, -1, -1, -1]` instead.


# Example

 For `s = "P01K02H03H04"`, the output should be `[12, 12, 11, 13]`.
 
 `1` card from `"P"` suit, `1` card from `"K"` suit, `2` cards from `"H"` suit, no card from `"T"` suit.
 
 For `s = "H02H10P11H02"`, the output should be `[-1, -1, -1, -1]`.
 
 There are two same cards `"H02"` in the string `s`.

Answer: {"fn_name": "cards_and_pero", "inputs": [["P01K02H03H04"], ["H02H10P11H02"], ["P10K10H10T01"], ["P05P01P02P03P13P09P11P07K01P12K03K02K13K12K10K08H03H02H13H12H10H08T01T03T02T13T12T10T08P04K07H02T07H06T11K11T05K05H05H11"], ["P01K02P03P11K09K10P13P10"]], "outputs": [[[12, 12, 11, 13]], [[-1, -1, -1, -1]], [[12, 12, 12, 12]], [[-1, -1, -1, -1]], [[8, 10, 13, 13]]]}
user: You've came to visit your grandma and she straight away found you a job - her Christmas tree needs decorating!

She first shows you a tree with an identified number of branches, and then hands you a some baubles (or loads of them!).

You know your grandma is a very particular person and she would like the baubles to be distributed in the orderly manner. You decide the best course of action would be to put the same number of baubles on each of the branches (if possible) or add one more bauble to some of the branches - starting from the beginning of the tree. 

In this kata you will return an array of baubles on each of the branches.

For example: 

10 baubles, 2 branches: [5,5]
5 baubles, 7 branches: [1,1,1,1,1,0,0]
12 baubles, 5 branches: [3,3,2,2,2]

The numbers of branches and baubles will be always greater or equal to 0.
If there are 0 branches return: "Grandma, we will have to buy a Christmas tree first!".

Good luck - I think your granny may have some minced pies for you if you do a good job!

Answer: {"fn_name": "baubles_on_tree", "inputs": [[5, 5], [5, 0], [6, 5], [50, 9], [0, 10]], "outputs": [[[1, 1, 1, 1, 1]], ["Grandma, we will have to buy a Christmas tree first!"], [[2, 1, 1, 1, 1]], [[6, 6, 6, 6, 6, 5, 5, 5, 5]], [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]]}
user: # Task
 John is new to spreadsheets. He is well aware of rows and columns, but he is not comfortable with spreadsheets numbering system.
```
Spreadsheet             Row Column
A1                      R1C1
D5                       R5C4
AA48                    R48C27
BK12                   R12C63```
Since John has a lot of work to do both in row-column and spreadsheet systems, he needs a program that converts cell numbers from one system to another.


# Example

 For `s = "A1"`, the result should be `"R1C1"`.

 For `s = "R48C27"`, the result should be `"AA48"`.
 
- Input/Output


 - `[input]` string `s`

  The position (in spreadsheet or row-column numbering system).

  `Spreadsheet : A1 to CRXO65535`
  
  `Row-Column: R1C1 to R65535C65535`
  
  
 - `[output]` a string

  The position (in the opposite format; if input was in spreadsheet system, the output should be int row-column system, and vise versa).

Answer: {"fn_name": "spreadsheet", "inputs": [["A1"], ["R1C1"], ["R5C4"], ["AA48"], ["BK12"], ["R12C63"], ["R85C26"], ["R31C78"], ["BZ31"]], "outputs": [["R1C1"], ["A1"], ["D5"], ["R48C27"], ["R12C63"], ["BK12"], ["Z85"], ["BZ31"], ["R31C78"]]}
user: If　`a = 1, b = 2, c = 3 ... z = 26`

Then `l + o + v + e = 54`

and `f + r + i + e + n + d + s + h + i + p = 108`

So `friendship` is twice stronger than `love` :-)

The input will always be in lowercase and never be empty.

Answer: {"fn_name": "words_to_marks", "inputs": [["attitude"], ["friends"], ["family"], ["selfness"], ["knowledge"]], "outputs": [[100], [75], [66], [99], [96]]}
user: Alex just got a new hula hoop, he loves it but feels discouraged because his little brother is better than him

Write a program where Alex can input (n) how many times the hoop goes round and it will return him an encouraging message :) 

-If Alex gets 10 or more hoops, return the string "Great, now move on to tricks".

-If he doesn't get 10 hoops, return the string "Keep at it until you get it".

Answer: {"fn_name": "hoop_count", "inputs": [[6], [10], [22]], "outputs": [["Keep at it until you get it"], ["Great, now move on to tricks"], ["Great, now move on to tricks"]]}
user: You will be given an array which lists the current inventory of stock in your store and another array which lists the new inventory being delivered to your store today.

Your task is to write a function that returns the updated list of your current inventory **in alphabetical order**.

## Example

```python
cur_stock = [(25, 'HTC'), (1000, 'Nokia'), (50, 'Samsung'), (33, 'Sony'), (10, 'Apple')]
new_stock = [(5, 'LG'), (10, 'Sony'), (4, 'Samsung'), (5, 'Apple')]

update_inventory(cur_stock, new_stock)  ==>
[(15, 'Apple'), (25, 'HTC'), (5, 'LG'), (1000, 'Nokia'), (54, 'Samsung'), (43, 'Sony')]
```

___

*Kata inspired by the FreeCodeCamp's 'Inventory Update' algorithm.*

Answer: {"fn_name": "update_inventory", "inputs": [[[], []]], "outputs": [[[]]]}
user: # Task:

We define the "self reversed power sequence" as one shown below:



Implement a function that takes 2 arguments (`ord max` and `num dig`), and finds the smallest term of the sequence whose index is less than or equal to `ord max`, and has exactly `num dig` number of digits.

If there is a number with correct amount of digits, the result should be an array in the form:

```python
[True, smallest found term]
[False, -1]
```

## Input range:

```python
ord_max <= 1000
```

___

## Examples:

```python
min_length_num(5, 10) == [True, 10]   # 10th term has 5 digits
min_length_num(7, 11) == [False, -1]  # no terms before the 13th one have 7 digits
min_length_num(7, 14) == [True, 13]   # 13th term is the first one which has 7 digits
```

Which you can see in the table below:

```
n-th Term    Term Value
1              0
2              1
3              3
4              8
5              22
6              65
7              209
8              732
9              2780
10             11377
11             49863
12             232768
13             1151914
14             6018785
```

___

Enjoy it and happy coding!!

Answer: {"fn_name": "min_length_num", "inputs": [[5, 10], [7, 11], [7, 14], [8, 16], [10, 20]], "outputs": [[[true, 10]], [[false, -1]], [[true, 13]], [[true, 15]], [[true, 17]]]}
user: You will be given an array of non-negative integers and positive integer bin width. 

Your task is to create the Histogram method that will return histogram data corresponding to the input array. The histogram data is an array that stores under index i the count of numbers that belong to bin i. The first bin always starts with zero. 

On empty input you should return empty output.

Examples:

For input data [1, 1, 0, 1, 3, 2, 6] and binWidth=1 the result will be [1, 3, 1, 1, 0, 0, 1] as the data contains single element "0", 3 elements "1" etc.
For the same data and binWidth=2 the result will be [4, 2, 0, 1]
For input data [7] and binWidth=1 the result will be [0, 0, 0, 0, 0, 0, 0, 1]

Answer: {"fn_name": "histogram", "inputs": [[[1, 1, 0, 1, 3, 2, 6], 1], [[1, 1, 0, 1, 3, 2, 6], 2], [[], 1], [[8], 1]], "outputs": [[[1, 3, 1, 1, 0, 0, 1]], [[4, 2, 0, 1]], [[]], [[0, 0, 0, 0, 0, 0, 0, 0, 1]]]}
user: # Task
 In a black and white image we can use `1` instead of black pixels and `0` instead of white pixels. 
 
 For compression image file we can reserve pixels by consecutive pixels who have the same color. 
 
 Your task is to determine how much of black and white pixels is in each row sorted by place of those.
 
# Example:

 For `height=2,width=100 and compressed=[40,120,40,0]`

 The result should be `[[40,60],[0,60,40,0]]`
 
 Sum of compressed array always divisible by width and height of image.
 
 Pixels available is in Compressed array in this order:
 
 `[Black,White,Black,White,Black,White,...]`
 
 ![](http://s3.picofile.com/file/8194350650/Compressed_Image_1_.png)

 For `height=2,width=100 and compressed=[0, 180, 20, 0]`

 The result should be `[[0,100],[0,80,20,0]]`

 ![](http://s6.picofile.com/file/8194348868/Compressed_Image.png)


# Input/Output


- `[input]` integer `height`

  Height of image


- `[input]` integer `width`

  Width of image


- `[input]` integer array `compressed`

  Consecutive pixels


- `[output]` 2D integer array

 The black and white pixels in each row.

Answer: {"fn_name": "black_and_white", "inputs": [[2, 100, [40, 120, 40, 0]], [2, 100, [0, 180, 20, 0]]], "outputs": [[[[40, 60], [0, 60, 40, 0]]], [[[0, 100], [0, 80, 20, 0]]]]}
user: Write
```python
smaller(arr)
```
that given an array ```arr```, you have to return the amount of numbers that are smaller than ```arr[i]``` to the right.

For example:
```python
smaller([5, 4, 3, 2, 1]) == [4, 3, 2, 1, 0]
smaller([1, 2, 0]) == [1, 1, 0]
```
``` haskell
smaller [5,4,3,2,1]  `shouldBe` [4,3,2,1,0]
smaller [1,2,3]      `shouldBe` [0,0,0]
smaller [1, 2, 0]    `shouldBe` [1, 1, 0]
```
If you've completed this one and you feel like testing your performance tuning of this same kata, head over to the much tougher version How many are smaller than me II?

Answer: {"fn_name": "smaller", "inputs": [[[5, 4, 3, 2, 1]], [[1, 2, 3]], [[1, 2, 0]], [[1, 2, 1]], [[1, 1, -1, 0, 0]], [[5, 4, 7, 9, 2, 4, 4, 5, 6]]], "outputs": [[[4, 3, 2, 1, 0]], [[0, 0, 0]], [[1, 1, 0]], [[0, 1, 0]], [[3, 3, 0, 0, 0]], [[4, 1, 5, 5, 0, 0, 0, 0, 0]]]}
user: Remember the movie with David Bowie: 'The Labyrinth'?

You can remember your childhood here: https://www.youtube.com/watch?v=2dgmgub8mHw

In this scene the girl is faced with two 'Knights" and two doors. One door leads the castle where the Goblin King and her kid brother is, the other leads to certain death. She can ask the 'Knights'  a question to find out which door is the right one to go in. But...

One of them always tells the truth, and the other one always lies.


In this Kata one of the 'Knights' is on a coffee break, leaving the other one to watch the doors. You have to determine if the one there is the Knight(Truth teller) or Knave(Liar) based off of what he ```says```

Create a function:
```
def knight_or_knave(says):
  # returns if knight or knave 
```
Your function should determine if the input '''says''' is True or False and then return:
```'Knight!'``` if True or ```'Knave! Do not trust.'``` if False

Input will be either boolean values, or strings.
The strings will be simple statements that will be either true or false, or evaluate to True or False. 

See example test cases for, well... examples

You will porbably need to ```eval(says)```

But note: Eval is evil, and is only here for this Kata as a game.

And remember the number one rule of The Labyrinth, even if it is easy, Don't ever say 'that was easy.'

Answer: {"fn_name": "knight_or_knave", "inputs": [[true], [false], ["4+2==5"], ["2+2==4"], ["not True and False or False or False"], ["3 is 3"], ["True"], ["not True"], ["2+2==5"], ["4+1==5"], ["4 is 3"], ["9+2==3"], ["105+30076==30181"], ["3 is 3 is 3 is 9"], ["False"], ["\"orange\" is not \"red\""], ["4 is \"blue\""], ["True is not False"]], "outputs": [["Knight!"], ["Knave! Do not trust."], ["Knave! Do not trust."], ["Knight!"], ["Knave! Do not trust."], ["Knight!"], ["Knight!"], ["Knave! Do not trust."], ["Knave! Do not trust."], ["Knight!"], ["Knave! Do not trust."], ["Knave! Do not trust."], ["Knight!"], ["Knave! Do not trust."], ["Knave! Do not trust."], ["Knight!"], ["Knave! Do not trust."], ["Knight!"]]}
user: Cara is applying for several different jobs.
The online application forms ask her to respond within a specific character count.
Cara needs to check that her answers fit into the character limit.

Annoyingly, some application forms count spaces as a character, and some don't.

Your challenge: 

Write Cara a function `charCheck()` with the arguments:

- `"text"`: a string containing Cara's answer for the question
- `"max"`: a number equal to the maximum number of characters allowed in the answer
- `"spaces"`: a boolean which is `True` if spaces are included in the character count and `False` if they are not

The function `charCheck()` should return an array: `[True, "Answer"]` , where `"Answer"` is equal to the original text, if Cara's answer is short enough.

If her answer `"text"` is too long, return an array: `[False, "Answer"]`. 
The second element should be the original `"text"` string truncated to the length of the limit.

When the `"spaces"` argument is `False`, you should remove the spaces from the `"Answer"`.

For example:

- `charCheck("Cara Hertz", 10, True)` should return `[ True, "Cara Hertz" ]`
- `charCheck("Cara Hertz", 9, False)` should return `[ True, "CaraHertz" ]`
- `charCheck("Cara Hertz", 5, True)` should return `[ False, "Cara " ]`
- `charCheck("Cara Hertz", 5, False)` should return `[ False, "CaraH" ]`

Answer: {"fn_name": "charCheck", "inputs": [["I am applying for the role of Base Manager on Titan.", 60, true], ["I am looking to relocate to the vicinity of Saturn for family reasons.", 70, true], ["As Deputy Base Manager on Phobos for five Martian years, I have significant relevant experience.", 90, false], ["A challenging career moment came with the rapid depletion of water supplies on Phobos.", 80, false], ["But, as I pointed out, anyone complaining about standing downwind was lying. There was no wind.", 75, true], ["I have no notice period on Phobos. I can start immediately.", 50, true]], "outputs": [[[true, "I am applying for the role of Base Manager on Titan."]], [[true, "I am looking to relocate to the vicinity of Saturn for family reasons."]], [[true, "AsDeputyBaseManageronPhobosforfiveMartianyears,Ihavesignificantrelevantexperience."]], [[true, "AchallengingcareermomentcamewiththerapiddepletionofwatersuppliesonPhobos."]], [[false, "But, as I pointed out, anyone complaining about standing downwind was lying"]], [[false, "I have no notice period on Phobos. I can start imm"]]]}
user: Complete the `greatestProduct` method so that it'll find the greatest product of five consecutive digits in the given string of digits.

For example:

The input string always has more than five digits.

Adapted from Project Euler.

Answer: {"fn_name": "greatest_product", "inputs": [["123834539327238239583"], ["395831238345393272382"], ["92494737828244222221111111532909999"], ["02494037820244202221011110532909999"]], "outputs": [[3240], [3240], [5292], [0]]}
user: This kata is part of the collection [Mary's Puzzle Books](https://www.codewars.com/collections/marys-puzzle-books).

# Zero Terminated Sum

Mary has another puzzle book, and it's up to you to help her out! This book is filled with zero-terminated substrings, and you have to find the substring with the largest sum of its digits. For example, one puzzle looks like this:
```
"72102450111111090"
```
Here, there are 4 different substrings: `721`, `245`, `111111`, and `9`. The sums of their digits are `10`, `11`, `6`, and `9` respectively. Therefore, the substring with the largest sum of its digits is `245`, and its sum is `11`.

Write a function `largest_sum` which takes a string and returns the maximum of the sums of the substrings. In the example above, your function should return `11`.

### Notes:

- A substring can have length 0. For example, `123004560` has three substrings, and the middle one has length 0.
- All inputs will be valid strings of digits, and the last digit will always be `0`.

Answer: {"fn_name": "largest_sum", "inputs": [["72102450111111090"], ["123004560"], ["0"], ["4755843230"], ["3388049750"], ["3902864190"], ["4098611970"], ["5628206860"], ["5891002970"], ["0702175070"]], "outputs": [[11], [15], [0], [41], [25], [30], [41], [23], [23], [15]]}