I also confused because of below description result. I understood that if there are same combination of two values, should return combination that distance between two values is shortest.
sum_pairs([10, 5, 2, 3, 7, 5], 10) # ^-----------^ 5 + 5 = 10, indices: 1, 5 # ^--^ 3 + 7 = 10, indices: 3, 4 * # * entire pair is earlier, and therefore is the correct answer == [3, 7]
If that, what is the below case's expected answer?
sum_pairs([10, 5, 2, 5, 3, 7, 5], 10)
Through my understanding, the expected combination is '[3, 7]'. If I was wrong, I am sorry confusing everyone.
sum_pairs([10, 5, 2, 5, 3, 7, 5], 10) ^-----^ 5 + 5 = 10, indices: 1, 3 ^--^ 3 + 7 = 10, indices: 4, 5 *
The one requirement is absent. 'the definition of valid spacing is one space between words'
Loading collection data...
I also confused because of below description result.
I understood that if there are same combination of two values, should return combination that distance between two values is shortest.
If that, what is the below case's expected answer?
Through my understanding, the expected combination is '[3, 7]'.
If I was wrong, I am sorry confusing everyone.
The one requirement is absent.
'the definition of valid spacing is one space between words'