Subsequence Weighting HACKERRANK