NPTEL Theory of Computation Assignment 7 Answer