Friend Pairing Problem

https://ide.codingblocks.com/s/69319

Q–https://www.geeksforgeeks.org/friends-pairing-problem/

I have used Recursion and Backtracking.
But How can I Optimize this code…

Image: https://drive.google.com/open?id=1hRSk-GMq9rRHNYLf0gtiynUpdmaq_g3d

Please Help…

@monikabhasin.sd17 use dynamic programming here is the code you can refer this.

Hey Monika,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.