# Mathematical

### Karatsuba Algorithm for fast Multiplication of Large Decimal Numbers represented as Strings

#include using namespace std;  string findSum(string str1, string str2){            if (str1.length() > str2.length())        swap(str1, str2);          string str = “”;          int n1 = str1.length();    int n2 =…

### Largest value of K that a set of all possible subset-sum values of given Array contains numbers [0, K]

Given an array arr[] of N integers, the task is to find the maximum count of K, i.e, consecutive integers…

### Lexicographically largest permutation by sequentially inserting Array elements at ends

Given an array arr[] of N integers, the task is to find the lexicographically largest permutation by sequentially inserting the…

### Minimize cost to modify the Array such that even indices have even elements and vice versa

Given an array arr[] of size N and two integers X and Y, the task is to find the minimum…

### Maximize sum of ratios of N given fractions by incrementing numerator and denominators K times by 1

#include using namespace std;  double maxAverageRatio(    vector& arr, int K){        int N = arr.size();          priority_queue q;          for (int i = 0; i < N; i++)…

### Count of non decreasing Arrays with ith element in range [A[i], B[i]]

#include using namespace std;  int totalValidArrays(int a[], int b[],                     int N){        int dp[N + 1][b[N – 1] + 1];          int pref[N + 1][b[N –…

### Check if end of given Binary string can be reached by choosing jump value in between given range

Given two positive integers L and R and a binary string S of size N, the task is to check…

### Find Nth root of a number using Bisection method

Given two positive integers N and P. The task is to find the Nth root of P.Examples: Attention reader! Don’t stop…