You are given an array of integers. Your task is to reorder the array such that the elements alternate between smaller and larger numbers. The sequence should follow the pattern nums[0] < nums[1] > nums[2] < nums[3] > nums[4]….
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique, and you may return the result in any order.
You are given a set of distinct positive integers. Return the largest subset where every pair of elements in the subset satisfies either ‘one element is divisible by the other’.
Given two sorted integer arrays nums1 and nums2 and an integer k, return the k pairs with the smallest sums. Each pair consists of one element from nums1 and one element from nums2.
A wiggle subsequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with one element and a sequence with two non-equal elements are trivially wiggle sequences. Given an integer array nums, return the length of the longest wiggle subsequence of nums.