Skip to content

POTD, merge without extra space. #3

Closed Answered by getlost01
VipinDhakad asked this question in Solution Ideas
Discussion options

You must be logged in to vote

Although your logic is correct, the problem still exists. This is because the problem states that to not use additional space, but your swap function uses a temporary variable temp multiple times(n times) in a loop for swapping.

By the way, this question is just complex because of these no extra space constraints else it is just a merge sort concept.

Thank you for reaching out and sharing your solution for diversifying solution ideas.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@VipinDhakad
Comment options

@getlost01
Comment options

Answer selected by getlost01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants