Michaels Interview Question

easy question about math and write down by Java