Arnab Chakraborty has Published 4293 Articles

3 and 7 in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:37:59

348 Views

Suppose we have a positive number n, we have to find that we can make n by summing up some non-negative multiple of 3 and some non-negative multiple of 7 or not.So, if the input is like 13, then the output will be True, as 13 can be written as ... Read More

3-6-9 in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:35:51

888 Views

Suppose we have a number n, we have to construct a list with each number from 1 to n, except when it is multiple of 3 or has a 3, 6, or 9 in the number, it should be the string "no-fill".So, if the input is like 20, then the ... Read More

24-hour time in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:33:50

4K+ Views

Suppose we have a string s. Here s is representing a 12-hour clock time with suffixes am or pm, we have to find its 24-hour equivalent.So, if the input is like "08:40pm", then the output will be "20:40"To solve this, we will follow these steps −hour := (convert the substring ... Read More

123 Number Flip in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:32:21

380 Views

Suppose we have an integer n, where only 1, 2, and 3 these digits are present. We can flip one digit to a 3. Then find the maximum number we can make.So, if the input is like 11332, then the output will be 31332To solve this, we will follow these ... Read More

Shortest Majority Substring in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:29:34

353 Views

Suppose we have a lowercase alphabet string s, we have to find the length of the shortest substring (minimum length is 2) such that some letter appears more than the other letters combined. If we cannot find any solution, then return -1.So, if the input is like "abbbcde", then the ... Read More

Rotate List Left by K in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:27:11

339 Views

Suppose we have a list of numbers. We have to define a method that can rotate a list of numbers to the left by k elements.So, if the input is like [5, 4, 7, 8, 5, 6, 8, 7, 9, 2], k = 2, then the output will be [8, ... Read More

Minimum Size of Two Non-Overlapping Intervals in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:24:36

310 Views

Suppose we have a list of intervals where each interval contains the [start, end] times. We have to find the minimum total size of any two non-overlapping intervals, where the size of an interval is (end - start + 1). If we cannot find such two intervals, return 0.So, if ... Read More

Minimum Bracket Addition in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:21:17

306 Views

Suppose we have a string s containing only '(' and ')', we have to find the minimum number of brackets that can be inserted to make the string balanced.So, if the input is like "(()))(", then the output will be 2 as "(()))(", this can be made balanced like "((()))()".To ... Read More

Linked List Jumps in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:19:02

378 Views

Suppose we have a singly linked list node containing positive numbers. We have to find the same linked list where every node's next points to the node val nodes ahead. If we cannot find such node, next will be null.So, if the input is like [2, 3, 10, 5, 9], ... Read More

Inverted Subtree in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:16:09

180 Views

Suppose we have two binary trees called source and target; we have to check whether there is some inversion T of source such that it is a subtree of the target. So, it means there is a node in target that is identically same in values and structure as T ... Read More

Advertisements