Skip to content

Category Archives: PHP

Given a n × m binary matrix, count the number of sets where a set can be formed one or more same values in a… Read More
Given a 4 x 4 matrix, we have to interchange the elements of first and last row and show the resulting matrix.Examples :   Input :… Read More
An array is given, find length of the subarray having maximum sum. Examples :  Input : a[] = {1, -2, 1, 1, -2, 1} Output… Read More
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix. … Read More
Given a matrix, the task is to find the maximum element of each row.Examples:   Input : [1, 2, 3] [1, 4, 9] [76, 34, 21]… Read More
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
In PHP, the array is a type of data structure that allows us to store similar types of data under a single variable. The array… 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

Start Your Coding Journey Now!