We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There's no mention of them being sequential in the problem statement. The mention is that i < j < k, in the sense that the first element of the triplet (i) must come before in the array than the second one (j) and similarly for k. There is no requirement for j = i + 1.
If you do code that requirement you will not be able to pass all the testcases.
Count Triplets
You are viewing a single comment's thread. Return to all comments →
There's no mention of them being sequential in the problem statement. The mention is that i < j < k, in the sense that the first element of the triplet (i) must come before in the array than the second one (j) and similarly for k. There is no requirement for j = i + 1. If you do code that requirement you will not be able to pass all the testcases.