GeeksforGeeks

A computer science portal for geeks

Latest articles

Minimum distance between any special pair in the given array

Given an array arr[] of N integers, the task is to find the minimum possible absolute difference between indices of a special pair. A special… Read More » The post Minimum distance between any special pair in the given array appeared first on GeeksforGeeks.

How to Become a Cyber Security Consultant?

The growing demand for the CyberSecurity domain in the tech world has increased the need for cybersecurity professionals in the industry, giving rise to various… Read More » The post How to Become a Cyber Security Consultant? appeared first on GeeksforGeeks.

Find H-Index for sorted citations using Binary Search

Given an array arr[] consisting of N integers in non-increasing order, representing citations, the task is to find the H-index. H-Index is usually assigned to… Read More » The post Find H-Index for sorted citations using Binary Search appeared first on GeeksforGeeks.

Distance from Next Greater element

Given an array arr[] of size N, the task is to print the distance of every array element from its next greater element. For array… Read More » The post Distance from Next Greater element appeared first on GeeksforGeeks.

Minimize cost to convert a given matrix to another by flipping columns and reordering rows

Given two binary matrices mat[][] and target[][] of dimensions N * M, the task is to find the minimum cost to convert the matrix mat[][]… Read More » The post Minimize cost to convert a given matrix to another by flipping columns and reordering rows appeared first on GeeksforGeeks.

Check if array can be sorted by swapping pairs with GCD of set bits count equal to that of the smallest array element

Given an array arr[] consisting of N integers, the task is to check if it is possible to sort the array using the following swap… Read More » The post Check if array can be sorted by swapping pairs with GCD of set bits count equal to that of the smallest array element appeared first on GeeksforGeeks.

Count subarrays for every array element in which they are the minimum

Given an array arr[] consisting of N integers, the task is to create an array brr[] of size N where brr[i] represents the count of… Read More » The post Count subarrays for every array element in which they are the minimum appeared first on GeeksforGeeks.

Length of second longest sequence of consecutive 1s in a binary array

Given a binary array arr[] of size N, the task is to find the length of the second longest sequence of consecutive 1s present in… Read More » The post Length of second longest sequence of consecutive 1s in a binary array appeared first on GeeksforGeeks.

Length of the longest subsequence consisting of distinct elements

Given an array arr[] of size N, the task is to find the length of the longest subsequence consisting of distinct elements only. Examples: Input:… Read More » The post Length of the longest subsequence consisting of distinct elements appeared first on GeeksforGeeks.

Ratio of all subarrays of size K

Given an array arr[] and an integer K, the task is to calculate the ratio of all subarrays of size K. Examples: Input: arr[] =… Read More » The post Ratio of all subarrays of size K appeared first on GeeksforGeeks.

Discover, share and read the best on the web

Subscribe to RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters! Get unfiltered news feeds or filter them to your liking.

Get Inoreader
Inoreader - Subscribe to RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters!