Arnab Chakraborty has Published 4452 Articles

Program to find where the ball lands in a grid box in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:43:34

134 Views

Suppose, we are given a m x n grid box, where each cell has a board that is positioned either from the top-right to bottom-left, or from the top-left to the bottom-right. Now from the top cells, a ball is put into the box and we have to check if ... Read More

Program to determine if two strings are close in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:40:53

379 Views

Suppose we have two strings, s and t, we have to check whether s and t are close or not. We can say two strings are close if we can attain one from the other using the following operations −Exchange any two existing characters. (like abcde to aecdb)Change every occurrence ... Read More

Program to implement a queue that can push or pop from the front, middle, and back in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:39:42

410 Views

Suppose, we are asked to implement a queue that can push and pop values at the front, middle, and back.We have to implement a pair of functions to push and pop for all three cases. We have to implement another function that shows the full queue at a given time.So, ... Read More

Program to find out the vertical area between two points where no point lies and is the widest in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:37:22

108 Views

Suppose, we are given n number of points as (x, y). A vertical area is an area that is extended infinitely along the y-axis. We have to find out the vertical area between two points such that no other point is inside the area and is the widest.So, if the ... Read More

Program to find minimum jumps to reach home in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:36:01

375 Views

Suppose there is an array called forbidden, where forbidden[i] indicates that the bug cannot jump to the position forbidden[i], and we also have three values a, b, and x. A bug's home is at position x on the number line. It is at position 0 initially. it can jump by ... Read More

Program to find out the inheritance order in a family in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:34:03

1K+ Views

Suppose, there is a family that consists of members from different generations. Such as the family has a father, his children, and their grandmother. But births and deaths happen in each family.The eldest member of the family is considered the head. So, when the 'head' member dies, their direct successor ... Read More

Program to find out the minimum rotations needed to maximize the profit from a Ferris wheel in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:30:39

108 Views

Suppose there is a Ferris wheel with four cabins and each cabin can contain four passengers. The wheel rotates counter-clockwise, and for each rotation, it costs 'run' amount of money. We now have an array 'cust' that contains n items and each item i signifies the number of people waiting ... Read More

Program to find minimum deletions to make string balanced in Python

Arnab Chakraborty

Arnab Chakraborty

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

418 Views

Suppose we have a string s with only two characters 's' and 't'. We can delete any number of characters of s to make the string balanced. We can say, s is balanced when there is no pair of indices (i, j) such that i < j and s[i] = ... Read More

Program to find maximum profit by selling diminishing-valued colored balls in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:18:13

211 Views

Suppose we have an array called, inventory, where inventory[i] represents the number of balls of the ith color we have initially. We also have a value called orders, which represents the total number of balls that the customer wants. we can sell the balls in any order. In our inventory ... Read More

Program to find out the farthest building a parkour artist can reach in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Oct-2021 07:13:44

115 Views

Suppose, there are n number of houses of different heights and a parkour artist wants to go from one house to another with help of some bricks and ladders. The heights of the houses are given to us as an array. Each brick is a unit length tall and we ... Read More

Advertisements