SPOJ White Hats

c-plus-plus
codechef
pucmm334
spoj
white-hats
wrong-answer

#1

CLICK HERE FOR PROBLEM STATEMENT

getting wrong answer . ! Can Anyone please give me the tricky cases ??


#2
These may help:
5
2 2 2 2 4
Answer = -1

5
3 3 1 3 3
Answer = -1

5
3 3 3 2 2
Answer=-1

5
4 4 4 4 4
Answer=5

5
5 5 4 4 4
Answer=-1

6
4 4 4 4 3 3
Answer=-1

6
0 1 1 1 1 1
Answer = 1

6
4 4 4 3 3 3
Answer=-1

Happy Coding! :)

#3

@shivam1511
The Answer for

5

4 4 4 4 4

would be 5, right?


#4

Yes…corrected :slight_smile: