Pertamina Interview Question

How to solve problem