Code: https://ide.codingblocks.com/s/96936
Test Case #6 fails despite optimisations
have a look in your modified code…
Thank You, it’s working now