
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7197 Articles for C++

216 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. If the given string starts with the ‘9’, we can find another string such that the sum of both becomes ‘11111…’. Problem statement – We have given a num string containing the numeric digits. We need to find the numeric string of the same length without leading zeros so that ... Read More

351 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. Problem statement − We have given a string named bin_Str of a particular length. The string contains only numeric digits from ‘0’ to ‘9’. We need to count the number of ways to partition the string in K substrings such that it follows the below condition. The substring should ... Read More

657 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 : Y ratio. The efficient approach uses the prefix sum technique to solve the problem. Problem statement − We have given a binary string of length bin_len. We need to count substrings having a number of 0s and 1s in the ratio of X : Y. Sample examples Input ... Read More

122 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 replacement operations. So, the problem is solved by finding the substrings with equal numbers of ‘0’ and ‘1’. Problem statement − We have given a binary string named bin_str and of length bin_len. We need to count the total number of substrings that we can make of length 1 by ... Read More

247 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 the string contains at least one ‘1’ and more than two adjacent consecutive characters, we can convert the alpha2 string to alpha1. Problem statement − We have given two binary strings of the same length. We need to check whether we can convert the alpha2 string to alpha1 by performing ... Read More

317 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 ‘.’ And ‘−‘. The code is prepared based on the transmission time, where ‘.’ Represents the short signals, and ‘−‘ represents the long signals. However, in this tutorial, we will use the standardized Morse code to decode and validate the string. Here is the table of standardized Morse code. ... Read More

127 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 statement − We have given two strings named alpha1 and alpha2. We need to check whether we can convert the string alpha1 to alpha2 by performing an unlimited number of below operations. Choose any index, and the character at the current and previous index is the same, insert the ... Read More

238 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, we will decide whether the string contains contiguous characters. Problem statement – We have given a string alpha of length N containing the lowercase and uppercase alphabetical characters. We need to check whether the given string is contiguous. The string is contiguous only if it contains all characters as a ... Read More

700 Views
The computer system must convert a user's high-level programming language program into machine code so that the computer's processor can run it. Multistep processing is the term used to describe the several processes involved in converting a user program into executable code. A user program will often go through a number of various phases during its multistep processing, including lexical analysis, syntactic analysis, semantic analysis, code creation, optimization, and linking. In order to convert the user program from its high-level form to machine code that can be run on a computer system, each of these stages is essential. User ... Read More

640 Views
Breadth To begin with, Look (BFS) may be a chart traversal calculation utilised to investigate hubs in a chart in a breadthward movement. The normal usage of BFS utilises a line information structure to keep track of hubs to come. In any case, it is conceivable to execute BFS without utilising an unequivocal line by utilising other information structures. One elective approach to actualizing BFS without a line is to utilise two clusters or records: one for the current level of hubs being investigated and another for the next level of hubs to be investigated. At first, the current level ... Read More