# frequency-counting

### Check if a Binary String can be split into disjoint subsequences which are equal to “010”

Check if a Binary String can be split into disjoint subsequences which are equal to “010”Given a binary string, S…

### Maximum frequency of any array element possible by at most K increments

Given an array arr[] of size N and an integer K, the task is to find the maximum possible frequency…

### Count substrings having frequency of a character exceeding that of another character in a string

#include using namespace std;void update(int ind, vector& segTree,            int n){        ind += n;        segTree[ind]++;    for (; ind > 1; ind >>= 1) {                segTree[ind >>…

### Count occurrences of substring X before every occurrence of substring Y in a given string

Count occurrences of substring X before every occurrence of substring Y in a given stringGiven three strings S, X, and…

### Generate an array consisting of most frequent greater elements present on the right side of each array element

#include using namespace std;  void findArray(int arr[], int n){        vector v;          for (int i = 0; i < n; i++) {                          int ans =…

### 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…

### Numbers of pairs from an array whose average is also present in the array

import java.io.*;import java.util.*;  class GFG {              static int getCountPairs(int arr[],                             int N, int S)    {        HashMap mp            = new HashMap();                          for (int i = 0; i <…

### Longest Non-Increasing Subsequence in a Binary String

Longest Non-Increasing Subsequence in a Binary StringGiven a binary string S of size N, the task is to find the…

### Number of substrings having an equal number of lowercase and uppercase letters

Number of substrings having an equal number of lowercase and uppercase lettersGiven string S consisting of lowercase and uppercase letters,…