# Binary Search

### Maximum number of teams of size K possible with each player from different country

Given an array arr[] consisting of N positive integers and a  positive integer K such that there are N countries,…

### Count of index range [L, R] in Array such that removing all its instances sorts the Array

Given an array arr[] of length N, the task is to find the number of Good Ranges in the array…

### Rearrange Array to find K using Binary Search algorithm without sorting

#include using namespace std;  void Rearrange(int arr[], int K, int N){        int ans[N + 1];              int f = -1;      for (int i = 0;…

### Minimum value of X such that sum of arr[i] – X raised to the power of brr[i] is less than or equal to K

Given an array arr[] and brr[] both consisting of N integers and a positive integer K, the task is to…

### Maximize the smallest array element by incrementing all elements in a K-length subarray by 1 exactly M times

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

### Minimum days to make Array elements with value at least K sum at least X

import java.io.*;class GFG{     static void findMinDays(int arr[], int R[], int N,                        int X, int K){                 int low = 0, high = X;    int minDays…

### Maximize boxes required to keep at least one black and one white shirt

Maximize boxes required to keep at least one black and one white shirt Given three numbers W, B, and O…

### Minimize K to let Person A consume at least ceil(N/(M + 1)) candies based on given rules

#include using namespace std;  bool check(int K, int n, int m,           vector arr,           int good_share){    int candies = n, taken = 0;      while (candies >…