Category: algorithms
Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that the difference between adjacent …
Given two integers L and R, find the count of numbers in the range (inclusive) having a prime number of set bits in their binary representation. (Recall that the …
Given an array A, partition it into two (contiguous) subarrays left and right so that: Every element in left is less than or equal to every element in right. …
A Stepping Number is an integer such that all of its adjacent digits have an absolute difference of exactly 1. For example, 321 is a Stepping Number while 421 …
Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, return a sorted array of only the integers that appeared in all three arrays. Example 1: …