Skip to content

Category Archives: Data Structures

Given a string str and a positive integer K. In an operation, you can select a character from the first K characters and move it… Read More
Given an array A consisting of N positive integers, the task is to calculate the maximum XOR of the subarray of size K consisting of… Read More
Given a string str and an integer N, the task is to print all possible sub-strings of length N. Examples: Input: str = “geeksforgeeks”, N… Read More
Given an array, arr[] containing n integers, the task is to find an integer (say K) such that after replacing each and every index of… Read More
Given a string S, the task is to print all the substrings of a string that has an equal number of vowels and consonants. Examples:… Read More
Arrays and Hash Tables are two of the most widely used data structures in computer science, both serving as efficient solutions for storing and accessing… Read More
Given an integer array of numbers num[], the task is to write a function to return the sum of the value of the array with… Read More
Given an array arr[] of N integers and an integer K, the task is to find the minimum possible value of summation of |A[i] –… Read More
Given a string str, the task is to find the number of ways two non-overlapping substrings of length N can be selected out of a… Read More
Given an array X[] of length N. In each operation, the following task is performed: Decrement any value by 1. Replace any pair with their… Read More
Given an array arr[] of length N. Find a positive integer K such that the difference between any pair of array elements is not a… Read More
Given an array arr[] of size N, Return the number of permutations of array arr[] which satisfy the condition arr[1] & arr[2] & . .… Read More
Segment Tree A segment tree is a data structure that can be used to efficiently store and query information about ranges in an array. It… Read More
Given an integer N, denoting the size of a circular array containing non-zero elements and an array arr[] of size M having the indices of… Read More
Given a binary matrix grid[][] of size M*N where ‘0‘ represents a blocked cell and ‘1’ represents a normal cell and a source (sx, sy)… Read More

Start Your Coding Journey Now!