Google Interview Question

Write a beam search algorithm in python