Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
yourYour code is not working for this casesome cases.Consider anfor example input 1 1 2 2 4,the ans.
The answer should be 6, but your code is returningreturns 1.
your code is not working for this case.Consider an input 1 1 2 2 4,the ans should be 6 but your code is returning 1.
Your code is not working for some cases.Consider for example input 1 1 2 2 4.
The answer should be 6, but your code returns 1.