Skip to main content
2 of 2
added 13 characters in body
janos
  • 113.1k
  • 15
  • 154
  • 396

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.