Hash

Minimum number of bricks that can be intersected

Given a 2D array arr[][], representing width of bricks of the same height present on a wall, the task is…

Minimum number of jumps required to sort numbers placed on a number line

#include using namespace std;void minJumps(int w[], int l[], int n){        if (n == 1) {        cout prevElementPos)            continue;                                while (currElementPos

Length of the longest substring consisting only of vowels in non-increasing order

import java.io.*;import java.util.*;  class GFG {                  static int count(String S, int N)    {                  char ch[] = { ‘u’, ‘o’, ‘i’, ‘e’, ‘a’ };                  int j…

Print greater elements present on the left side of each array element

Print greater elements present on the left side of each array elementGiven an array arr[] consisting of N distinct integers,…

Queries to find the sum of weights of all nodes with vertical width from given range in a Binary Tree

#include using namespace std;  struct Node {    int data;    Node* left;    Node* right;};  Node* newNode(int d){    Node* n = new Node;    n->data = d;    n->left = NULL;    n->right =…

Minimum time required to schedule K processes

import java.util.*;import java.lang.*;  class GFG {              static int minTime(int[] A, int n, int K)    {                int max_ability = A[0];                  for (int i = 1; i…

Find the array element having equal count of Prime Numbers on its left and right

#include using namespace std;  int findIndex(int arr[], int N){            int maxValue = INT_MIN;          for (int i = 0; i < N; i++) {        maxValue…

Minimum time required to complete all tasks with alteration of their order allowed

Minimum time required to complete all tasks with alteration of their order allowedGiven a string S consisting of N characters…