Skip to content

Category Archives: PHP Programs

Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element.Examples: Input: {5, 32,… Read More
An array consisting of N integers is given. There are several Right Circular Rotations of range[L..R] that we perform. After performing these rotations, we need… Read More
In mathematics, a square matrix is said to be diagonally dominant if for every row of the matrix, the magnitude of the diagonal entry in… Read More
Given an array of size N, the task is to determine whether its possible to sort the array or not by just one shuffle. In… Read More
Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. … Read More
Given an array arr[], count number of pairs arr[i], arr[j] such that arr[i] + arr[j] is maximum and i < j. Example : Input :… Read More
Given an array of N distinct integers. The task is to write a program to check if this array is sorted and rotated counter-clockwise. A… Read More
Given an array, right rotate it by k elements.   After K=3 rotation   Examples:   Input: arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9,… Read More
Given a square matrix, turn it by 90 degrees in anti-clockwise direction without using any extra space.Examples :   Input: Matrix: 1 2 3 4 5… Read More
Given a string, we need to find the minimum number of rotations required to get the same string. Examples: Input : s = "geeks" Output… Read More
You are given an array A[] of n-elements and a positive integer k (k > 1). Now you have find the number of pairs Ai,… Read More
Given a m x n 2D matrix, check if it is a Markov Matrix.Markov Matrix: The matrix in which the sum of each row is… Read More
Given an integer x, the task is to find if every k-cycle shift on the element produces a number greater than or equal to the… Read More
Given a matrix of size N*M, and a number K. We have to rotate the matrix K times to the right side. Examples:   Input : N… Read More
An array contains both positive and negative numbers in random order. Rearrange the array elements so that positive and negative numbers are placed alternatively. Number… Read More

Start Your Coding Journey Now!