IBM Interview Question

valid tokens and minimum total cost