Algorithm · Apple · Easy
Given an integer array nums, identify each number n that meets both of the following requirements: The value n occurs only once in nums. The array contains neither n - 1 nor n + 1. Produce these values in increasing order. Examples Example 1: Input: nums = [2, 5, 8, 11] Output: [2, 5, 8, 11] Explanation: Each number occurs a single time, and none has a value one less or one greater elsewhere in the array. Example 2: Input: nums = [4, 5, 9, 12] Output: [9, 12] Explanation:…
Checking your access…