Union Of Two Sorted Arrays Leetcode Problems Javascript Substring