What is Time complexity of the editorial solution. is it o(n^3)?


#1

What is Time complexity of the editorial solution. is it o(n^3)??


#2

The time complexity of the approach will be O(N3) as there are N * N states in total and each state takes O(N) time to solve in general.