Merge Two Sorted Arrays Without Duplicates
Problem of the Day: You are given two sorted arrays of integers, nums1 and nums2. Your task is to merge them into a single sorted array that contains only unique elements. Do not use any built-in sorting function. Use only one loop to traverse and merge. 1. Input: nums1 = [1, 3, 5, 7, 9] nums2 = [2, 3, 5, 6, 8, 9] Output: [1, 2, 3, 5, 6, 7, 8, 9] 2. Input: nums1 = [2, 4, 6, 8] nums2 = [1, 3, 5, 7, 9] Output: [1, 2, 3,4, 5, 6, 7, 8, 9] .snippet-thumbnail img { max-width: 50px; height: auto; object-fit: cover; }