Complexity of this problem


#1

can solve in n^2 complexity