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

# Tag Archives: array-traversal-question

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

Given an array A[] consisting of N integers, the task is to check if the sum of numbers of digits in each array element is… Read More

Given an array arr[] of N positive integers with an equal number of even and odd elements. The task is to use in-place swapping to… Read More

Given a 2D array arr[] consisting of N coordinates of the form (X, Y), the task is to find a coordinate from the given array… Read More

Given a sorted array arr[] consisting of N distinct integers and an integer K, the task is to find the index of K, if it’s… Read More