Union Of Two Sorted Arrays Leetcode Problems Javascript