Skip to content

Category Archives: Mathematical

Given an array arr[] which consists of a permutation of first N natural numbers, the task is to find any triplet (i, j, k) from… Read More
Given two arrays arr[] and brr[] consisting of N and M positive integers respectively, the task is to find all the elements from the array… Read More
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to maximize the GCD of the array arr[]… Read More
Given a string S representing a sequence of moves(L, R, U, and D) and two integers X and Y representing the starting coordinates, the task… Read More
Given a positive integer S, the task is to find the length of diagonal of a square having sides of length S. Examples: Input: S… Read More
Given an array arr[] consisting of N natural numbers, the task is to find the length of the longest subsequence from the array which does… Read More
Given a python dictionary, the task si to count even and odd numbers present in the dictionary. Examples: Input : {‘a’: 1, ‘b’: 2, ‘c’:… Read More
Given an array arr[] consisting of N positive integers, the task is to find the sum of all array elements having a distinct count of… Read More
Given two positive integers N and X, the task is to count the occurrences of the given integer X in an N-length square matrix generated… Read More
Given an array arr[] consisting of N positive integers, the task is to check if the sum of the elements of any subset of the… Read More
Given an array arr[] consisting of N positive integers, the task is to count the number of subarrays consisting only of pronic numbers. Examples: Input:… Read More
Given a lower triangular matrix Mat[][], the task is to store the matrix using row-major mapping. Lower Triangular Matrix: A Lower Triangular Matrix is a… Read More
Given a matrix mat[][] of dimensions N * M, and an integer K, the task is to find the maximum sum of any rectangle possible… Read More
Given a circular array arr[] consisting of N integers, the task is to replace all the array elements with the nearest possible power of its… Read More
Given an array A[] of size N, the task is to count the number of subsequences from the given array whose Bitwise XOR value is… Read More