Arnab Chakraborty has Published 3734 Articles
Arnab Chakraborty
355 Views
Suppose we have a string; we have to find the longest palindrome that can be generated by deleting or shuffling the characters from the string. And if there are more than one palindrome then return only one.So, if the input is like pqqprrs, then the output will be pqrsrqp.To solve ... Read More
Arnab Chakraborty
205 Views
Suppose we have two arrays; we have to find the longest possible bitonic sequence so that the increasing part should be from first array and should be a subsequence of first array. similarly decreasing part of must be from second array and a subsequence of the second one.So, if the ... Read More
Arnab Chakraborty
159 Views
Suppose we have a binary tree; we have to find the largest subtree having identical left and right subtree. Preferred time complexity is O(n).So, if the input is likethen the output will beTo solve this, we will follow these steps −Define a function solve() . This will take root, encode, ... Read More
Arnab Chakraborty
520 Views
Suppose we have one encoded string where repetitions of substrings are represented as substring followed by count of substrings. As an example, if the string is "pq2rs2" and k=5, so output will be 'r', this is because the decrypted string is "pqpqrsrs" and 5th character is 'r'. We have to ... Read More
Arnab Chakraborty
321 Views
Suppose we have one binary array. We have to find the position of 0 that can be replaced with 1 to get maximum number of continuous sequence of 1s.So, if the input is like [1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1], then the output ... Read More
Arnab Chakraborty
222 Views
Suppose we have two strings S1 and S2 of same lengths, we have to find an index i such that S1[0…i] and S2[i+1…n-1] give a palindrome when they are concatenated together. When it is not possible, return -1.So, if the input is like S1 = "pqrsu", S2 = "wxyqp", then ... Read More
Arnab Chakraborty
261 Views
Suppose we have a graph, we also have a source vertex and a number k. The k is the path length of graph between source to destination, we have to check whether we can find a simple path (without cycle) starting from source and ending at any other vertex (as ... Read More
Arnab Chakraborty
176 Views
Suppose we have three different types of cups in array p and saucers in array q and m number of shelves, we have to check whether a neat arrangement of cups and shelves can be made.We can say that arrangement of the cups and saucers will be neat if it ... Read More
Arnab Chakraborty
122 Views
Suppose we have a range of cost from lowCost to upCost and another range of quantity from lowQuant to upQuant, we have to check whether we can find the given ratio r where r=cost/quantity, and lowCost ⇐ cost ⇐ upCost and lowQuant ⇐ quantity ⇐ upQuant.So, if the input is ... Read More
Arnab Chakraborty
148 Views
Suppose we have binary tree; we have to check whether the given vertical level of the binary tree is sorted or not. When two nodes are overlapping, check they are in sorted sequence in the level they belong.So, if the input is like l = -1then the output will be ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP