Given two arrays of element between 0 to N- 1 of length N. Find the lexicographically smallest array c such that for any index i c[i] = ( a[i] + b[i])%N. To ...read more
Prerequisite – What is Algorithm | Introduction to Algorithms Advantages of Divide and Conquer Solving difficult problems: Divide and conquer is an efficient method for solving difficult problems. For example, consider the ...read more
Prerequisite – C Language Introduction C comments explain code and improve readability. These do not affect program execution. You can use comments in C to clarify code and describe algorithms. There are two ...read more
Prerequisite – C Language Introduction The C programming language has various versions: C89/C90, C99, C11, and C18. C89/C90: Released in 1989/1990. It introduced key language features. C99: This brought new features like ...read more
Prerequisite – C Language Introduction C is a simple language made in 1972 by Dennis Ritchie. It’s for system programming. C has low-level memory access, basic keywords, good for systems like OS. ...read more
Find the minimum number ‘N’ such that the sum of ‘N’ natural numbers is greater than or equal to a given number ‘NUM’ using Binary Search. In this problem, we need to ...read more
Recursion is a powerful way of developing algorithms in which the solution of a problem is determined by the solution of one or more identical subproblems. A recursive solution involves two parts: ...read more
We’re given a function in the format of f(x). We have to find the minimum absolute difference between f(x) and given number k over a range (0 – 10^6). This article assumes ...read more
Two integers n and k is given. Find number of integers i from 1 to n such than difference of i and sum of digits of i is greater than k. Examples: ...read more
In a prison, there are N cells. The positions of the cells are given in an array. The Jailer has to place all the prisoners in the cells in an ordered manner ...read more