Find the first run of numbers summing to n
code-golf subsequence number
Given as input a number n
and a sequence of digits 0-9
(which may be taken as a string or a list), find the first contiguous subsequence of digits in the sequence that sums to n
and output the start and end indexes. You may use zero- or one-based indexing. If no such subsequence exists, your program may output any constant value.
Examples
These examples use zero-based indexing.
Input: 10 123456789
Output: 0 3
Input: 32 444444444
Output: 0 7
Input: 33 444444444
Output: No solutions