sir jab m code banna raha hoon toh woh chal raha hai jab
m (j-i)(j-i+1)/2 ka liya magar theoretically har website p
likhaa hai ki (j-i+1)(j-i+2)/2 is valid to calculate length of distinct subarray but in code we use(j-i)*(j-i+1)/2 why
Subaaray with distinact elements
There must be differences in indexing.
Actually it is N (N+1)/2 where N is the length of the subarray.
If subarray begins from i and ends at j. Then N=j-i+1
If subarray begins from i and ends at j-1. Then N=j-i
Check if this is the case.