Please Help

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

Question link : https://www.codechef.com/problems/STICKS

Code Link : https://www.codechef.com/viewsolution/12360350

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

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

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

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