Skip to content

Tag Archives: binary-representation

Given an integer N, the task is to construct a binary matrix of size N * N such that the sum of each row and… Read More
Given three positive integers L, R, and K, the task is to find the count of numbers in the range [L, R] having K consecutive… Read More
Given a binary array, in which, moving an element from index i to index j requires abs(i – j) cost. The task is to find… Read More
Given an integer N, the task is to find the minimum positive product of first N – 1 natural numbers, i.e. [1, (N – 1)],… Read More
Given a binary matrix arr[][] of dimensions N * M , the task is to count the number of right-angled triangles that can be formed… Read More
Given an array arr[] consisting of N integers, the task is to find the maximum sum of the squares of array elements possible from the… Read More
Given a boolean matrix mat[][] of size M * N, the task is to print the count of indices from the matrix whose corresponding row… Read More
Given two binary matrices mat[][] and target[][] of dimensions N * M, the task is to find the minimum cost to convert the matrix mat[][]… Read More
Given a binary array arr[] of size N, the task is to find the length of the second longest sequence of consecutive 1s present in… Read More
Given two integers L and R, the task is to count the numbers having only one unset bit in the range [L, R]. Examples: Input:… Read More
Given an array arr[] consisting of N integers, the task is to find the total number of distinct subsequences having Binary Equivalence. A subsequence has… Read More
Given two decimal numbers num1 and num2, the task is to count the number of times carry operation is required while adding the two given… Read More