Skip to content

# Tag Archives: array-traversal-question

Given an array arr[] and an integer K, the task is to find the absolute difference between the ceil of the total sum of the… Read More
Given a matrix A[][] of size N*M and a 2D array Q[][] consisting of queries of the form {X, K}, the task for each query… Read More
Given a matrix of size M x N consisting of integers, the task is to print the matrix elements using Breadth-First Search traversal. Examples: Input:… Read More
Given an array arr[] of size N, the task is to find the minimum increments by 1 required to be performed on the array elements… Read More
Given a 2D square matrix arr[][] of dimensions N x N, the task is to find the maximum path sum by moving diagonally from any… Read More
Given an array arr[] of size N, where arr[i] is the time required to visit ith city, the task is to find the minimum total… Read More
Given a matrix arr[][] of size N * M, the task is to print the matrix after removing all rows and columns from the matrix… Read More
Given an array arr[] of size N, the task is to check if the array is spirally sorted or not. If found to be true,… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to check if the sum of the array can be… Read More
Given an array A[] consisting of N integers, where each value represents the marks of the ith student, the task is to find the minimum… Read More
Given an array arr[] consisting of N integers and three integers X, Y, and K, the task is to find the farthest index that can… Read More
Given an array arr[] consisting of N of integers, the task is to find the minimum positive value S that needs to be added such… Read More
Given an array arr[], the task is to obtain a non-decreasing array with the maximum sum from the given array by repeatedly decrementing array elements… Read More
Given a 2D array arr[][] consisting of N rows of the form {Xi, Yi, Ri} such that (Xi, Yi) represents the position of a tower… Read More
Given an array arr[] consisting of N integers. Two players, Player 1 and Player 2, play turn-by-turn in which one player can may either of… Read More