Arnab Chakraborty has Published 4282 Articles

Find the product of first k nodes of the given Linked List in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Nov-2019 08:17:25

148 Views

Consider we have few elements in a linked list. We have to find the multiplication result of first k number of elements. The value of k is also given. So if the list is like [5, 7, 3, 5, 6, 9], and k = 3, then result will be 5 ... Read More

Find the perimeter of a cylinder in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Nov-2019 08:07:19

214 Views

Suppose we have the diameter and the height of the cylinder, we have to find the perimeter of the cylinder. As the perimeter is the outline of two dimensional object, then we cannot find the perimeter of one three dimensional object directly. We can make a cross section of the ... Read More

Find the other-end coordinates of diameter in a circler in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Nov-2019 08:03:14

114 Views

Suppose we have the center coordinate and one coordinate point on the perimeter of the circle. We have to find the another point on the perimeter. Consider the center points are (p, q), and one given point is (a, b). We have to find the point (x, y). As we ... Read More

Find the Number which contain the digit d in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Nov-2019 08:01:20

205 Views

Consider we have a digit d, and the upper limit n. we have to find all numbers that contains d in range 0 to n. So if n = 20, and digit is 3, then the numbers will be [3, 13].To solve this problem, we will take every number as ... Read More

Find the Next perfect square greater than a given number in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Nov-2019 07:55:45

563 Views

Suppose we have a number n. our task is to find next perfect square number of n. So if the number n = 1000, then the next perfect square number is 1024 = 322.To solve this, we have get the square root of the given number n, then take the ... Read More

Find the length of each string element in the Numpy array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Nov-2019 07:52:59

183 Views

Here we will see how to get the length of each string element in the Numpy Array. Numpy is a library for Numeric Python, and it has very powerful array class. Using this we can store data in an array like structure. To get the length we can follow two ... Read More

Find sum of factorials in an array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Nov-2019 07:43:09

286 Views

Consider we have an array A, which is sorted. It has all elements appears twice, but one element is present for only one time. We have to find that element. If the array is [1, 1, 3, 3, 4, 4, 5, 6, 6, 7, 7, 9, 9], so the single ... Read More

Find numbers a and b that satisfy the given condition in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 01-Nov-2019 10:35:58

588 Views

Consider we have an integer n. Our task is to find two numbers a and b, where these three conditions will be satisfied.a mod b = 0a * b > na / b < nIf no pair is found, print -1.For an example, if the number n = 10, then ... Read More

Find N digits number which is divisible by D in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 01-Nov-2019 10:33:46

194 Views

Suppose we have two numbers N and D. We have to find N digit number, that is divisible by D. If N is 3, and D is 5, then the number can be 500. This can be solved easily. If D is 10 and N is 1, then it will ... Read More

Find most significant set bit of a number in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 01-Nov-2019 10:28:04

2K+ Views

Here we will see if a number is given, then how to find the value of Most Significant Bit value, that is set. The value is power of 2. So if the number is 10, MSB value will be 8.We have to find the position of MSB, then find the ... Read More

Advertisements