Count bases which contains a set bit as the Most Significant Bit in the representation of NGiven a positive integer N, the task is to count the number of different bases in which, when N is represented, the most significant bit of N is a found to be a set bit.Examples:Input: N = 6Output: 4Explanation: […]

Continue ReadingCount numbers up to N that cannot be expressed as sum of at least two consecutive positive integersGiven a positive integer N, the task is to find the count of integers from the range [1, N] such that the integer cannot be expressed as sum of two or more consecutive positive integers.Examples:Input: N = 10Output: […]

Continue ReadingPrint all array elements having frequencies equal to powers of K in ascending order Given an array arr[] consisting of N integers and a positive integer K, the task is to find the array elements having frequencies in the power of K i.e., K1, K2, K3, and so on. Examples: Input: arr[] = {1, 3, […]

Continue Reading