Skip to content

Conversation

@jhm9595
Copy link
Owner

@jhm9595 jhm9595 commented Nov 7, 2022

Time complexity : O(NM)

@jhm9595 jhm9595 requested a review from bigelephant29 November 7, 2022 05:32
@bigelephant29
Copy link
Collaborator

Sorry I just moved to Europe this month so I didn't have a computer.

As for this question I think your thought was a bit too complicated.

I'd recommend you to write down some cases on paper and try to get if there's any pattern that you can find for next permutation.

You should be able to solve this question in O(N) with a very simple solution, but you just need to find it first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants