Arnab Chakraborty has Published 3734 Articles

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

319 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

220 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

Program to check subarrays can be rearranged from arithmetic sequence or not in Python

Arnab Chakraborty

Arnab Chakraborty

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

232 Views

Suppose we have sequence of numbers nums, and another two arrays l and r of size m, these l and r are representing range queries like [l[i], r[i]]. We have to find a Boolean sequence ans, where ans[i] is true when the subarray nums[l[i]], nums[l[i] + 1], ... nums[r[i] - ... Read More

Program to split two strings to make palindrome using Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Oct-2021 14:24:40

869 Views

Suppose we have two strings a and b whose length are same. We have to select an index and split both strings at that selected index, splitting a into two strings: a_pref and a_suff where a = a_pref | a_suff, and splitting b into two strings: b_pref | b_suff (| ... Read More

Program to find out the number of people who get a food packet using Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Oct-2021 14:09:05

488 Views

Suppose in a conference, there are two types of people. The first type of people prefers a vegetarian lunch, and the other type prefers a non-vegetarian lunch. But there are a limited number of packets, and if the vegetarians receive a non-vegetarian packet or vice versa; they will not take ... Read More

Program to maximize the minimum force between balls in a bucket using Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Oct-2021 13:38:36

318 Views

Suppose we are given several buckets and x number of balls. If the balls are put into the bucket, a special force acts within them and we have to find out a way to maximize the minimum force between two balls. The force between two balls in a bucket of ... Read More

Program to find array of doubled pairs using Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Oct-2021 13:28:52

186 Views

Suppose we have an array of called nums whose length is even, we have to check whether it is possible to reorder it in such a way that nums[2*i + 1] = 2*nums[2*i] for every 0 cnt[2 * x], thenreturn Falsecnt[2 * x] := cnt[2 * x] - cnt[x]return ... Read More

Program to find the most competitive subsequence in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Oct-2021 13:20:01

361 Views

Suppose we have an array nums and another value k, we have to find the most competitive subsequence of nums of size k. Here a subsequence s1 is more competitive than a subsequence s2 (of equal size) if in the first position where s1 and s2 differ, subsequence s1 has ... Read More

Program to merge in between linked lists in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Oct-2021 13:11:11

1K+ Views

Suppose we have two linked lists L1 and L2 of length m and n respectively, we also have two positions a and b. We have to remove nodes from L1 from a-th node to node b-th node and merge L2 in between.So, if the input is like L1 = [1, ... Read More

Program to find ways to make a fair array in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Oct-2021 12:45:38

376 Views

Suppose we have an array called nums. We can select exactly one index and remove the element from that index. (The index of the elements may change after the removal). We can say an array is fair when the sum of the odd-indexed values equals the sum of the even-indexed ... Read More

Advertisements