Solution to DEVCLASS?

This is my python code to devclass, it failed to pass the subtasks with type=2! Could anyone give me a strong test case?
http://www.codechef.com/viewsolution/6515762

Your program is not getting compiled due to an extra else in (if f==1:). Also the answer for type 1 is equal to type 2. For more detail read tutorial of the question, it is given clearly there.

Check for BBBGG.Your code will give answer 5 but the answer should be 3.

It gives 3 as the answer.

Check the answer link once again.