• + 3 comments

    Nice thinking!! Also B[i]+1 is unncessesary.. And boundaries check needed.. But really elegant logic..