Sudhir sharma has Published 1149 Articles

C++ program to find Nth Non Fibonacci Number

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 07:43:34

939 Views

In this problem, we are given an integer value N. Our task is to use a C + + program to find the Nth Non Fibonacci Number.Fibonacci Series generates subsequent number by adding two previous numbers. The Fibonacci series starts from two numbers − F0 & F1. The initial values ... Read More

Find the row with maximum number of 1s using C++

sudhir sharma

sudhir sharma

Updated on 14-Feb-2022 07:39:08

291 Views

In this problem, we are given a binary matrix where elements of each row are sorted. Our task is to find the row with maximum number of 1s.Let’s take an example to understand the problem, Inputmat[][] = {{ 0 1 1 1}    {1 1 1 1}    {0 0 ... Read More

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

sudhir sharma

sudhir sharma

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

346 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

133 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

268 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

200 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 repetitive element between 1 to n-1 using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 12:00:18

206 Views

In this problem, we are given an unordered array arr[] of size N containing values from 1 to N-1 with one value occuring twice in the array. Our task is to find the only repetitive element between 1 to n-1.Let’s take an example to understand the problem, Inputarr[] = {3, ... Read More

Find the only repeating element in a sorted array of size n using C++

sudhir sharma

sudhir sharma

Updated on 11-Feb-2022 11:50:52

333 Views

In this problem, we are given an arr[] of size N containing values from 1 to N-1 with one value occuring twice in the array. Our task is to find the only repeating element in a sorted array of size n.Let’s take an example to understand the problem, Inputarr[] = ... 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

152 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

Advertisements