Please Help

Getting Wrong answer. please tell me what’s wrong with my logic

Question link : STICKS Problem - CodeChef

Code Link : CodeChef: Practical coding for everyone

You haven’t handled the case in which there are more than 3 sticks having same length which are bigger in size. In this case it can be taken as both base and height.
for example:

3 3 3 3 2 2

Answer should be 9.But your code gives 6 as output.

1 Like

change your life in some aspect <ahref=“http://www.corriganandcompany.com/case-study-by-dr-devicharan-shetty-dc-shetty-on-reproducibility/”>Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty
Dr Devi Charan Shetty it

yup… i missed this one… thanks … :slight_smile:

you can upvote my answer if you found it correct. thanks