Shubham Vora has Published 962 Articles

Convert given Binary String to Another in Minimum Operations by Flipping all Bits Except any 1

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:39:38

362 Views

In this problem, we need to convert one binary string to another binary string by flipping the characters of the string. We can hold any set bit and flip other bits, and we need to count the total operation to achieve another string by doing it. We can solve the ... Read More

Check if the String has a Reversible Equal Substring at the Ends

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:38:08

64 Views

In this problem, we need to find the reversible equal substring of maximum length from the start and end of the string. The problem is very similar to finding the palindromic string. We can start traversing the string and traverse the string until characters from the start and end match. ... Read More

Abbreviate given String by Replacing all Characters with Length Except the First and Last

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:36:13

109 Views

In this problem, we need to transform the string of a length greater than 2 into its abbreviation form. We can use the ‘length’ property of the string to count the total number of middle characters in the string, and we can first and last characters using the respected index ... Read More

Sorting given Character Array using Linked List

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:32:25

152 Views

In this problem, we need to sort the given array of characters using a linked list. We can use bubble sort, selection sort, merger sort, etc. techniques to sort the array. Here, we will convert the array into the linked list first and then use the selection sort and bubble ... Read More

Python3 Program for Minimum Rotations Required to get the Same String

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:28:47

52 Views

In this problem, we need to find the total number of rotations to get the same string. The naïve approach to solving the problem is that we can keep rotating the string. We can print the total number of required rotations if we find the same string. Also, other approaches ... Read More

Python Program for Generating Lyndon Words of Length n

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:27:24

58 Views

In this problem, we will find all Lyndon words using the array's alphanumeric characters. Before we start, let’s understand the definition of the Lyndon word. All words are Lyndon words which are strictly lexicographically smaller than all of their rotations. Here are examples of Lyndon words. ... Read More

PHP Program for Minimum Rotations Required to get the Same String

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:26:07

49 Views

In this problem, we need to achieve the same string by performing the rotations of the string and need to count rotations. There can be different ways to solve the problem, but here we will learn some best approaches in PHP. The first approach uses the rotational substring, and another ... Read More

Minimize Replacement of Bits to make the Count of 01 Substring Equal to 10 Substring

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:23:50

70 Views

Problem statement − We have given the binary string of length N. We need to find the minimum number of flipping characters required to get the balanced binary string. Flipping characters means converting 0 to 1 and 1 to 0. If any string contains an equal number of ‘01’ and ... Read More

Javascript Program to Check If a String is Substring of Another

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:22:10

160 Views

In this problem, we need to ensure whether the string String2 contains string String1 as a substring. We will first see the naïve approach to solving the problem, finding all substrings of String1’s length in String2 with String1. Furthermore, we will use built−in methods like match(), includes(), and indexOf() methods ... Read More

Java Program to Recursively Remove All Adjacent Duplicates

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:16:22

376 Views

We need to remove all adjacent duplicate characters from the string in this problem. We can use a recursive or iterative approach to solve the problem. Here, we first need to remove the adjacent duplicate elements from the left part of the string. After that, we need to recursively remove ... Read More

Advertisements