Ansoft Interview Question

Programming algorithm