added Narayna alogirthm and solution for Problem 24.