TWOFL - Editorial

getWho is the “find” while who is the “parent” array compared to the usual DSU implementation.

Hi @akamoha, Could you please elaborate on how you determined the worst case to be O(n^2 * m^2) considering this particular case? Also if you could explain a little bit about how the editorialist’s initial estimation was 8mn? Thanks!

1 Like

hi @smartnj , i don’t know why but when i submitted same solution of yours , i am getting tle in some of the cases , is it happening because of constant factor or is the time complexity analysis wrong ?