TEKsystems interview question

puzzle que, java and Python related que