Sudhir sharma has Published 951 Articles

Find the repeating and the missing number using two equations in C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 13:06:01

413 Views

In this problem, we are given an array arr[] of size N. It consists of integer values ranging from 1 to N. And one element x from the range is missing whereas one element y in the array occurs double. Our task is to find the repeating and the missing ... Read More

Find the position of the last removed element from the array using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 13:00:07

173 Views

In this problem, we are given an array arr[] of size N and an integer value M. Our task is to find the position of the last removed element from the array.The removal of values from the array is based on the operations −For an element in the array arr[i]. ... Read More

Find the overlapping sum of two arrays using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 12:51:25

312 Views

In this problem, we are given two arrays arr1[] and arr2[] consisting of unique values. Our task is to find the overlapping sum of two arrays.All elements of the arrays are distinct. And we need to return the sum of elements which are common for both arraysLet’s take an example ... Read More

Find the other end point of a line with given one end and mid using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 12:42:55

243 Views

In this problem, we are given the coordinates of two points of a line starting point A(xA, yA) and midpoint M(xM, yM) .Our task is to find the other end point of a line with given one end and mid.Let’s take an example to understand the problem, InputA = [1, ... Read More

Find the only missing number in a sorted array using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 11:45:42

2K+ Views

In this problem, we are given an arr[] of size N containing values from 1 to N with one value missing in the array. Our task is to find the only missing number in a sorted array.Let’s take an example to understand the problem, Inputarr[] = {1, 2, 3, 5, ... Read More

Find the only element that appears b times using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 11:41:26

194 Views

In this problem, we are given an arr[] of size n and two integers a and b. Our task is to find the only element that appears b times.All values of the array occur a time except one value which occurs b times in the array and we need to ... Read More

Find the only different element in an array using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 11:36:37

290 Views

In this problem, we are given an arr[] of size n. Our task is to find the only different element in an array.There are only two different types of elements in the array. All the elements are the same except one.Let’s take an example to understand the problem, Inputarr[] = ... Read More

Find the one missing number in range using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 11:31:24

637 Views

In this problem, we are given an arr[] of size n. Our task is to find the one missing number in range.The array consists of all values ranging from smallest value to (smallest + n). One element of the range is missing from the array. And we need to find ... Read More

Maximum occurring character in an input string using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 11:27:16

6K+ Views

In this problem, we are given an input string of lowercase characters. Our task is to maximum occurring character in an input string.In case of multiple values with the same frequency of occurrence, we need to print lexicographically smaller values.Let’s take an example to understand the problem, Inputstring = “programming”OutputgSolution ... Read More

Find the number of zeroes using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 11:22:03

1K+ Views

In this problem, we are given a binary array bin[] consisting of only 0’s and 1’s. Our task is to find the number of zeroes.The array is sorted i.e. all 0’s are arranged together after 1’s.Let’s take an example to understand the problem, Inputarr[] = {1, 1, 1, 0, 0, ... Read More

Advertisements