Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

PRBLEM IN NOTATRI

$
0
0

one of the practice problem have struct me off http://www.codechef.com/problems/NOTATRI here is the problem link i jst checked the solution and found that if we sort the array first check as array is sorted for(third=N-1;third>1;third--) { first=0; second=third-1; while(second>first) { if(len[first]+len[second]<len[third]) { count+=second-first; first++; } else { second--; } } } this part is the main logic for the given problem and this leads me in confusion how can we do this
count+=second-first;


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>