1346. Check If N and Its Double Exist
Given an array arr of integers, check if there exist two indices i and j such that
Given an array arr of integers, check if there exist two indices i and j such that
You are given two positive integer arrays spells and potions, of length n and m respectively, where spells[i] represents the strength of the ith spell and potions[j] represents the strength of the jth potion.
You are given an integer array nums and an integer k.You are allowed to perform the following operation on each element of the array at most once:Add an integer in the range [-k, k] to the element.Return the maximum possible number of distinct elements in nums after performing the operations.
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.