NOT ABE TO UNDERSTND what to do ? And also explain the question please

Given an array, the task is to calculate the sum of lengths of contiguous subarrays having all elements distinct

Input Format
An integer n denoting size of array followed by n integers

Hi @ayush_r18
in this question we are given an array with distinct elements i.e all elements are different.
And now our task is to add the length of all continious subarray as we all know that the whole array itself is also an subarray then we will take 2 2 elements and then all single elements and add the all lengths.
Remember subarray is same concept as subsets in Maths.

{1, 2, 3} is a subarray of length 3 with distinct elements. Total length = 3. {1, 2}, {2, 3} are 2 subarray of length 2 with distinct elements. Total length of lengths two = 2 + 2 = 4 {1}, {2}, {3} are 3 subarrays of length 1 with distinct element. Total lengths of length one = 1 + 1 + 1 = 3 Sum of lengths = 3 + 4 + 3 = 10

I Hope you are now clear with question and if you still face any issue please let me know.