The solution that I came up with for merge sort uses while loops, because I know it will avoid the time complexity of O(n2). I've also seen that a lot of the solutions that have the best time complexity uses the while loop.
I wanted to know if there's a solution where you can avoid the O(n2) time complexity using the for loop instead of the while loop.
Thanks!