Help in The Byterace contest

RICY
MY SOL

i first found minimum between 1st index and last index and according to min index i divide the the B array int two parts…and rest anyone call follow my code.

it is showing TLE. can anyone help me out to spot the error?
my time complexity:O(nlogn)