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
Category Archives: Mathematical
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 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 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