How to get count of number elements which are greater than current element in an arraylist : <p>I have an arraylist [10,11,1,2,3,6,11,10]. For each element, I want to get count of elements which are greater than current element.</p>

<p>For example, for 10, only 11 is greater than it and there are 2 occurances of it.
For 11, nothing is greater than it. So 0.</p>

<p>So we have to print output like 
10,2
11,0
1,7
2,6
3,5
6,4
11,0
10,2</p>
