Help with "Arpa chooses brother free subset"

Problem link: Log In | HackerEarth

My code: #include <bits/stdc++.h>using namespace std;typedef long long ll;ll - Pastebin.com

My logic is explained in detail through comments in my code. I’m new to DP, so any kind of help would be appreciated :slight_smile: