Find the minimum difference between Shifted tables of two numbers
Given two numbers ‘a’ and ‘b’. Find the minimum difference between any terms in shifted infinite tables of ‘a’ and ‘b’, given shifts ‘x’ and… Read More »
Given two numbers ‘a’ and ‘b’. Find the minimum difference between any terms in shifted infinite tables of ‘a’ and ‘b’, given shifts ‘x’ and… Read More »
Given a set of n integers where n <= 40. Each of them is at most 1012, determine the maximum sum subset having sum less… Read More »
Given a number positive number n, find value of f0 + f1 + f2 + …. + fn where fi indicates i’th Fibonacci number. Remember… Read More »
Bitonic Sequence A sequence is called Bitonic if it is first increasing, then decreasing. In other words, an array arr[0..n-i] is Bitonic if there exists… Read More »
Bitonic Sequence A sequence is called Bitonic if it is first increasing, then decreasing. In other words, an array arr[0..n-i] is Bitonic if there exists… Read More »
Background Bitonic Sort is a classic parallel algorithm for sorting. Bitonic sort does O(n Log 2n) comparisons. The number of comparisons done by Bitonic sort… Read More »
Given a set of n jobs where each job i has a deadline di >=1 and profit pi>=0. Only one job can be scheduled at… Read More »
Prerequisites : Grundy Numbers/Nimbers and Mex We have already seen in Set 2 (https://www.geeksforgeeks.org/combinatorial-game-theory-set-2-game-nim/), that we can find who wins in a game of Nim… Read More »
How to find the largest number with given digit sum s and number of digits d? Examples: Input : s = 9, d = 2… Read More »
We have introduced Combinatorial Game Theory in Set 1 and discussed Game of Nim in Set 2. Grundy Number is a number that defines a… Read More »
How to find the smallest number with given digit sum s and number of digits d? Examples : Input : s = 9, d =… Read More »
Given a string, find out if the string is K-Palindrome or not. A k-palindrome string transforms into a palindrome on removing at most k characters… Read More »
Online Written Test: Multiple choice questions on aptitude and programming 2 coding questions. F2F R1 1) Given a string of any length. print all possible… Read More »
Standard C library provides qsort function that can be used for sorting an array. Following is the prototype of qsort() function. // Sort an array… Read More »
Given a grid of numbers, find maximum length Snake sequence and print it. If multiple snake sequences exists with the maximum length, print any one… Read More »