One of the assignments of Stanford CS193p course.