@Kartheek
Ashish algo is perfectly working....By making before[0]&after[length-1]=1
the array is shifted ,which prevents the inclusion of current index.....
Ex:
int a[5]={10,4,8,3,9}
before[0]=1
before[1]=10
before[2]=40
before[3]=320
before[4]=960
after[4]=1
after[3]=9
after[2]=27
after[1]=216
after[0]=864
ans[0] = ( before[0]=1 )*(after[0]=864)
.............
.
.
similarly others
---------
Naveen
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.