Module supports numbers with max 3 digits.
Tests
Simple question
| Expected | Actual |
|---|---|
| 150 | |
| 15 | |
| 7 | |
| 150 | |
| 15 | |
| 7 |
Complex question
| Expected | Actual |
|---|---|
| 6 | 11 |
| 7 | 11 |
| 10 | 12 |
| 99 | 12 |
| 101 | 13 |
| 6 | 2 |
| 7 | 2 |
| 10 | 3 |
| 99 | 3 |
| 101 | 4 |
local p = {}
function p.getParagraphFromQuestion(param)
i,j = string.find(param.args[1], '-', 1, true);
return j
end
return p