Arnab Chakraborty has Published 4293 Articles

C++ program to convert digits to words using conditional statements

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Oct-2021 07:20:49

970 Views

Suppose we have a digit d, we shall have to convert it into words. So if d = 9, our output should be "Nine". If we provide some d which is beyond the range of 0 and 9, it will return appropriate output.So, if the input is like d = ... Read More

Program to find minimum one bit operations to make integers zero in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Oct-2021 07:20:00

315 Views

Suppose we have a number n, we have to transform it into 0 using the following operations any number of times βˆ’Select the rightmost bit in the binary representation of n.Change the ith bit in the binary representation of n when the (i-1)th bit is set to 1 and the ... Read More

Program to find out how many transfer requests can be satisfied in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Oct-2021 07:13:27

100 Views

Suppose, there are n number of hostel rooms numbered from 0 to n-1. The students in the hostel rooms want to transfer to another room, and they place several requests to do that. No hostel seat remains vacant, a transfer request is only taken care of if another student takes ... Read More

C++ program to take integer and float as input and return their sum

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Oct-2021 07:07:54

3K+ Views

Suppose we have two numbers a and b, a is integer and b is a float. We shall have to take them from standard input and display the sum.So, if the input is like a = 10 b = 56.23, then the output will be Sum: 66.23To solve this, we ... Read More

Program to find out the shortest path to reach the goal in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 13:53:47

422 Views

Suppose, we are given a grid where the cells contain various symbols such as 'X', 'O', '*' and '#' and the symbols have various meanings.'#' is the goal cell that we want to reach.'O' is a free cell via which we can travel to the goal cell.'*' is our position ... Read More

Program to find largest submatrix with rearrangements in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 13:39:57

321 Views

Suppose we have an m x n binary matrix, we can rearrange the columns of the matrix in any order. We have to find the area of the largest submatrix within matrix where every element of the submatrix is 1 after performing some reordering task.So, if the input is like101111001then ... Read More

Program to find kpr sum for all queries for a given list of numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 13:32:02

313 Views

Suppose we have a list of numbers nums. We also have a list of queries where queries[i] contains three elements [k, p, r], for each query we shall have to find kpr_sum. The formula for kpr_sum is like below.$$\mathrm{{π‘˜π‘π‘Ÿ}\_{π‘ π‘’π‘š} =\sum_{\substack{𝑖=𝑃}}^{π‘…βˆ’1}\sum_{\substack{𝑗=𝑖+1}}^{𝑅}(𝐾 βŠ•(𝐴[𝑖]βŠ•π΄[𝑗]))}$$If the sum is too large, then return sum modulo ... Read More

Python program to find list of triplets for which i+j+k is not same as n

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 13:28:34

198 Views

Suppose we have three numbers i, j and k and another number n. We shall have to find the list of all triplets (i, j, k) for which i+j+k not same as n. We shall have to solve this problem using list comprehension strategy.So, if the input is like i ... Read More

Program to find tuple with same product in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 13:27:38

496 Views

Suppose we have an array nums with unique positive values, we have to find the number of tuples (a, b, c, d) such that a*b = c*d where a, b, c, and d are elements of nums, and all elements a, b, c and d are distinct.So, if the input ... Read More

Python program to check a number n is weird or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 13:25:28

1K+ Views

Suppose we have a number n. We shall have to check whether n is weird or not. Here a number is weird when βˆ’ 1. The number is odd 2. The number is not in range 2 to 5 3. The number is even and in range 6 to 20So, ... Read More

Advertisements