Intel Corporation interview question

Math Problem solving with coding