Hostel Visit getting wrong answer in first test case

What mistake Am I making here.