![]() |
| [Hackerrank] Solution of Beautiful Triplets in JavaScript |
The 10th test case isn't satisfying the criteria of a[i] > a[i-1] at the time of solving this problem.
The test case is :
10 3
1 6 7 7 8 10 12 13 14 19
The 2 consecutive 7, 7 is the problem.
If your program is relying strictly on the fact arr[i] > arr[i-1] (like mine), then it's not your program's fault for giving wrong answer.
![[Hackerrank] Solution of Beautiful Triplets in JavaScript [Hackerrank] Solution of Beautiful Triplets in JavaScript](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh39n0KBUVwD0iBF7lgYO-lp06D4fdalHhXxozXPPf2rpjcnLNBXQCUxfktC0WFcwWWnRBIuD9cD4nu64EW-JzXoaoR39om8gwoV3c7NazLsTeJdg1TZXT20UnDImmzRb4qh2SkGydNG7U/s320/hackerrank.png)
0 nhận xét: