You are viewing a single comment's thread. Return to all comments →
From my point of view it is not even O(2n). We should take in count complexity of solving algorithm, not complexity of preparing input data.
so can you please tell me how to reduce it ? i mean the complexity? because i am not able to clear 1 test case.
Do you have trouble with test case that is posted for this task? If so I posted above implementation that passed all tests for this task.