Arnab Chakraborty has Published 4452 Articles

Next Closest Time in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:44:10

247 Views

Suppose we have a time represented in the format "HH: MM", we have to generate the next closest time by reusing the current digits. We can use the digit an unlimited number of times.So, if the input is like "19:34", then the output will be "19:39" as the next closest ... Read More

Path Sum IV in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:42:17

218 Views

Suppose we have a list of integers that is representing a binary tree with a depth smaller than 5. If the depth of a tree is less than 5, then this tree can be represented by a list of three-digit integers. For each integer in this list −The hundreds digit ... Read More

Equal Tree Partition in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:38:49

341 Views

Suppose we have a binary tree with n nodes, our task is to check whether it's possible to partition the tree to two trees which have the equal sum of values after deleting exactly one edge on the original tree.So, if the input is likethen the output will be true.To ... Read More

4 Keys Keyboard in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:36:11

778 Views

Suppose we will try to write the letter ‘A’, using the keyboard. Our goal is to use only four keys and try to write maximum ‘A’s on the text field. The keys are ‘A’, ‘C’, ‘V’, and ‘Ctrl’.To write a maximum number of A, we will use Ctrl + A ... Read More

Design Log Storage System in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:32:07

293 Views

Suppose we have some logs, that each log contains a unique id and timestamp. The Timestamp is a string that has the format: Year:Month:Day:Hour:Minute: Second, for example, 2019:01:01:23:59:59. All domains are zero-padded decimal numbers.We have to design a log storage system to implement the following functions −void Put(int id, string ... Read More

Find the Derangement of An Array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:29:44

251 Views

Suppose we have an array consisting of n numbers from 1 to n in increasing order, we have to find the number of derangements it can generate.We know that in combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element will appear in ... Read More

Minimum Factorization in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:26:26

96 Views

Suppose we have a positive integer x, we have to find the smallest positive integer b whose multiplication of each digit equals to x. If we have no such answer then return 0.So, if the input is like 48, then the output will be 68To solve this, we will follow ... Read More

Add Bold Tag in String in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:24:12

2K+ Views

Suppose we have a string s and a list of strings called dict, we have to add a closed pair of bold tag and to wrap the substrings in s that exist in that dict. When two such substrings overlap, then we have to wrap them together by ... Read More

Kill Process in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:21:40

2K+ Views

Suppose we have n processes, here each process has a unique id called PID or process id and its PPID (parent process id) is also there.Each process only has one parent process, but may have one or more child processes.This is just like a tree structure. Only one process has ... Read More

Squirrel Simulation in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Nov-2020 14:16:20

236 Views

There's a tree, a squirrel, and several nuts. Positions are represented by the cells in a 2D grid. Your goal is to find the minimal distance for the squirrel to collect all the nuts and put them under the tree one by one. The squirrel can only take at most ... Read More

Advertisements