The algorithm for dealing with the problem is as follows:
समस्या निवारण के लिए एल्गोरिथ्म इस प्रकार हैः