I do not understand the question and the testCase.Please Explain…
Explanation of given TestCase
Consider all the subarrays as follows:
(1), (2), (3), (1 2), (2 3), (1 2 3)
We need to calculate the sum of lengths of the subarrays in which all elements are distinct i.e in this case 1 + 1 + 1 + 2 + 2 + 3 = 10