POTD, merge without extra space. #3
-
void swap(long long arr1[], long long arr2[], int j, int k){
|
Beta Was this translation helpful? Give feedback.
Answered by
getlost01
Jul 14, 2023
Replies: 1 comment 2 replies
-
Thanks for your solution idea. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.