I got the idea of dimension compression (4D -> 3D) but I am unable to get the transitions. Code URL : https://pastebin.com/Zc27bCXm
TLE in 1 Test Case
Hey @zanj0
Just think of it this way
for each 1<=i<=n there are n1*n2 possible states
that way you can write the compressions maybe
Hey. I understood the fact that there will be b + g = N as one of the dimension and n1, n2 as the second and third dimensions respectively so the total time complexity will be n^3 but I am unable to implement it. Please help me in implementing it.
Thanks a lot for the help!
1 Like
I have already closed it.
1 Like