I tried so solve this problem using two pointer technique but I'm getting some precision error in the last test, Is it a precision error, or there's something my code isn't handling, or my logic from the very beginning is wrong?
And thank you for your time.