Sudhir sharma has Published 951 Articles

First element that appears even number of times in an array in C++

sudhir sharma

sudhir sharma

Updated on 01-Feb-2022 07:22:24

316 Views

In this problem, we are given an array arr[] consisting of N integer values. Our task is to create a program for finding the first element that appears even number of times in an array. If any element exists that satisfies the condition return it otherwise return -1 denoting false.Let's ... Read More

Frugal Number in C++

sudhir sharma

sudhir sharma

Updated on 01-Feb-2022 07:15:58

178 Views

In this problem, we are given a positive integer N. Our task is to create a program to check whether the given number is a Frugal number or not.FRUGAL NUMBER − A number whose number of digits is strictly greater than the number of digits in the prime factorization of ... Read More

Flatten a multilevel linked list in C++

sudhir sharma

sudhir sharma

Updated on 31-Jan-2022 12:54:39

590 Views

In this problem, we are given a multilevel linked list. Our task is to create a program to flatten a multilevel linked list.The flattening operation is done in such a way that the first level nodes will occur first in the linked list and then the second level nodes will ... Read More

Fizz Buzz Implementation in C++

sudhir sharma

sudhir sharma

Updated on 31-Jan-2022 12:31:34

6K+ Views

In this problem, we will see the implementation and types of Fizz-Bizz problem.Fizz Buzz − it is a simple programming problem in which the programmer changes the occurrence o all multiples of 3 by ‘Fizz’ and all multiples of 5 by ‘Buzz’ in the numbers from 1 to 100.Let’s take ... Read More

Fitting Shelves Problem in C++

sudhir sharma

sudhir sharma

Updated on 31-Jan-2022 12:22:51

412 Views

In this problem, we are given three integer values W, n, m denoting the length of wall W, size of shelves n, and m. Our task is To Create a Program to solve the Fitting Shelves Problem.We need to find a way to fit shelves in such a way that ... Read More

Find the largest twins in given range in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:43:13

240 Views

In this problem, we are given two values lValue and hValue. Our task is to find the largest twins in given range.Two numbers are said to be twin numbers if both of them are prime numbers and the difference between them is 2.Let's take an example to understand the problem, ... Read More

Find the largest pair sum in an unsorted array in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:32:16

1K+ Views

In this problem, we are given an arr[] consisting of N unsorted elements. Our task is to find the largest pair sum in an unsorted array.We will find a pair whose sum is the maximum.Let's take an example to understand the problem, Input : arr[] = {7, 3, 9, 12, ... Read More

Find the largest number with n set and m unset bits in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:28:26

212 Views

In this problem, we are given two integer values, n and m. Our task is to find the largest number with n set and m unset bits in the binary representation of the number.Let's take an example to understand the problemInput : n = 3, m = 1 Output : ... Read More

Find the Largest number with given number of digits and sum of digits in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:21:10

2K+ Views

In this problem, we are given two integer values, N denoting the count of digits of a number and sum denoting the sum of digits of the number. Our task is to find the largest number with given number of digits and sum of digits.Let's take an example to understand ... Read More

Find the largest node in Doubly linked list in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 11:13:04

388 Views

In this problem, we are given a doubly linked list LL. Our task is to find the largest node in Doubly Linked List.Let's take an example to understand the problem, Input : linked-list = 5 -> 2 -> 9 -> 8 -> 1 -> 3 Output : 9Solution ApproachA simple ... Read More

Advertisements