UNIONSET code review June Long, How this can be optimized ?

link text

Use frequency hashes for data storing and manipulation

See my code :::

Add a condition between your loops about sum of lengths of array being less than k, if sum of length is less than k, don’t proceed. For details check : https://www.codechef.com/viewsolution/14098476

1 Like