Damn. I had this idea, but I thought it might not work and decided to do dynamic programming that didn't pass the memory limit 😢😢
@DCCNITA Жыл бұрын
Sad🥲
@ghoul_786 Жыл бұрын
Why we are dointg this ??? int e = cnt; mx = max(mx, s + e);
@DCCNITA Жыл бұрын
Bcz, S is count of Ones in the start of the string and E is count of Ones in the end of the string. So if you make some right shift operations then you will get that there will be a possibility in which these S+E ones will be consecutive.