What is Square root Decomposition? I was reading editorial of a problem on hackerrank and came acroos this term.

I tried searching on google, read various forums but couldn’t understand how this could optimise a code.

Can anyone please provide a simple explanation of this problem and give a clear, easy and intuitive code for the same?

Thanks in advance