Just for a change let’s solve a simple array question from Leetcode today
Question link: https://leetcode.com/problems/merge-sorted-array/description/
Imagine both lists as a Ball machine at an arcade. We keep the smallest ball in our bucket and let the new ball slide in. When one of the machines has been exhausted we simply empty the other machine because they are all sorted
Let’s take up a test case and analyze
Test case: [1,2,5,6] ****[3,4]
We take 2 pointers for L1 and L2 respectively.
TASKs