WA for Feb19 Challenge Problem

Could anyone please point out why(which constraint is violated) I am getting WA for this submission

If Case 2 is skipped code works, fails otherwise

//