Login and get codingWrite a function that accepts a list of strings and returns the total of the indices of the items.
Example 1:
['a', 'b', 'c']
=>0 + 1 + 2 = 3
The indices for duplicate items should be accumulated in the total as they appear.
Example 2:
['a', 'b', 'b', 'c']
=>0 + 1 + (1+2) + 3 = 7
Example 3:
['a', 'b', 'b', 'c', 'a', 'b', 'a']
=>0 + 1 + (1+2) + 3 + (0+4) + (1+2+5) + (0+4+6) = 29
60 out of 62 users completed this Bite.
Will you be the 61st person to crack this Bite?
Resolution time: ~38 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 3.0 on a 1-10 difficulty scale.
» You can do it! 😌