Is my method ccorrect?

https://ide.codingblocks.com/s/264830.
Sir, i have written code and is much simpler than the merge sort approach code. Is the code good?

hi @aryaman.kumar26 you can try submitting the solution on hackerblocks and see if it is passing all the test cases or not.