Https://ide.codingblocks.com/s/89193


one test case is not passing.help me out.

Just sort the array before running the loops on it. No need for all those if-else conditions.

Updated Code - https://ide.codingblocks.com/s/89607