With more explaination about the idea to solve the question