Shubham Vora has Published 962 Articles

Find all Words from String Present after Given N Words

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:54:21

72 Views

In this problem, we will find each word of the string which comes after all words of the ‘words’ array. The first approach to solve the problem is to split the string into words and match elements of the words[] array with the string words. If we find words[] array’s ... Read More

Find a Number Such that Sum of N with it is a Palindrome

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:46:17

121 Views

In this problem, we will find the string of length equal to the given string so that when we sum both strings, we get the palindromic strings. Here, we can find another string such that the sum of both becomes 99999…, the largest palindromic string of the same length. ... Read More

Count ways to Split String into K Substrings Starting with Even Digit and Min Length M

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:42:49

170 Views

In this problem, we will count ways to partition the given string into the K substrings such that it follows the condition given in the problem statement. We will use the recursion to solve the problem. Also, we will use the tabular dynamic programming approach to solve the problem efficiently. ... Read More

Count Substrings with Number of 0s and 1s in Ratio of X : Y

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:40:18

298 Views

In this problem, we will count substrings of the given binary string containing the number of ‘0’ and ‘1’ characters in the X : Y ratio. The naïve approach finds all substrings of the given binary string, counts ‘0’ and ‘1’, and checks whether the counts are in the X ... Read More

Count Substrings that can be Made of Length 1 by Replacing "01" or "10" with 1 or 0

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:37:57

54 Views

In this problem, we will count substrings that we can make of length 1 by replacing the ‘10’ and ‘01’ substrings with ‘1’ or ‘0’ characters. When any binary string contains an equal number of ‘0’ and ‘1’, we can always make it of length 1 by performing the ... Read More

Check if given Morse Code is Valid

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:34:36

162 Views

In this problem, we will validate the Morse code. The Morse code method was used to transform the text in the encoded format, and it was very helpful to provide communication between two entities before the telephone was invented. There are standard codes for each alphabetical character containing the ‘.’ ... Read More

Check if two Binary Strings can be Made Equal by Doing Bitwise XOR of Adjacent

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:22:54

118 Views

In this problem, we will check whether we can convert string alpha2 to alpha1 by performing the XOR operation of any two adjacent characters and replacing both characters with an XOR value. We will use the logic based on the XOR value of two digits to solve the problem. If ... Read More

Check if a String can be Converted to Another by Inserting Character Same as both Neighbours

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:15:24

56 Views

In this problem, we will check whether we can convert the string alpha1 to alpha2 by inserting the same characters between any two same characters of the given string. We will use the run length encoding algorithm to solve the problem, which counts the frequency of the contiguous characters. Problem ... Read More

Check if a Character is Only Occurring as One Single Contiguous Substring or Not

Shubham Vora

Shubham Vora

Updated on 17-Jul-2023 12:02:34

120 Views

In this problem, we will check whether all characters are present continuously in the given string. We will use the map data structure to solve the problem. The map will keep track of the last index of the particular character, and based on the last index of the current character, ... Read More

How to set the width of the bottom border animatable using CSS?

Shubham Vora

Shubham Vora

Updated on 17-May-2023 14:13:12

626 Views

In CSS, we can use the ‘border-bottom’ CSS property to set the bottom border for an HTML element. We can use the animation property to animate the width of the bottom border. Also, we require to define the keyframes by changing the width of the bottom border to animate it. ... Read More

Advertisements