I had previously posted a question, Given an array, find out the next smaller element for each element
now, i was trying to know , if there is any way to find out \"given an ar
//some array called newarray
for(int x=0; x <=array.length;x++)
{
for(int y=x;y
something like this,where array is your input array and newarray your output array
make sure to initialize everything correctly(0 for the newarrays values)