# Category Archives: Mathematical

Given a string S of length N representing an integer that consists of only characters ‘1’, ‘2’ and ‘3’, the task is to find the… Read More
Given, two integers N (always even) and X, the task is to find an array of size N with distinct numbers, such that the sum… Read More
Given an array B1[] and a binary array B2[] each of size N, the task is to rearrange array B1[] in a way such that… Read More
Given an array arr[] that contains N real numbers. The task is to sort the array in decreasing order of the Fractional Values Note: If… Read More
Given an array A[] of length N and an integer K, the task is to maximize the value of expression [i.j – K.(Ai | Aj)]… Read More
Given N sized binary array A[] containing all 0’s initially. The task is to find the final count of 1’s after flipping the bits at… Read More
Given a range [L, R] and an integer K, find all the groups in the given range having at least K consecutive composite integers.  … Read More
Given two integers L and R, and an array arr[] containing single digit integers, the task is to find all the integers in the range… Read More
Given an array arr[] and an integer L which represents the number of bits to be considered in bit representation of an array element. The… Read More
Given the initial congestion window size cwnd, threshold value ssthresh, connection time rtt and an array arr where arr[i] implies the time when a packet… Read More
Given an array Arr[ ] of N integers where 1 ≤ N ≤ 105. The task is to choose any number of elements from the… Read More
Given an array arr[] of size N, the task is to find the minimum value range [L, R] such that: The array can be divided… Read More
Given a 2D array A[][] of size N x 2 where: Every element lies between [1, N]. A[i][0] signifies that there must be at most… Read More
Given two integers M and N, the task is to generate an MxN matrix having elements in range [1, MxN] such that the average of… Read More
Given a number N, the task is to represent N as sum of maximum number of unique positive integers. Examples:  Input: N = 12Output: 1+… Read More