|
|
back to boardhints Posted by Abid29 7 Apr 2021 13:24 AA=0,AB=1,BA=2,BB=3 cnt[0]=no. of AA,cnt[1]=no. of AB........... int sz=2; if(last letter==A) szvalue=0; if(last letter==B) szvalue=2; define DP[cnt[0]+2][cnt[1]+2][cnt[2]+2][cnt[3]+2][sz]; dp 1,0,0,0,0=1; //for AA dp 0,1,0,0,1=1; //for AB |
|
|