Class assignment doubt


please check whats wrong with code

Your correct and AC code


Small mistake in only printing, Logic is correct