# Strings

## Consecutive characters count in String with JavaScript

Print the given string with the consecutive characters count next to each character, for example, Input: “aabccca” then Expected Output: “a2b1c3a1”. I tried a couple of things and decided to go with a simple for loop as this gives us access to the index with a single iteration, i.e., Linear… Read More »Consecutive characters count in String with JavaScript

## Count Vowels in a String with JavaScript

Problem Statement: For any given string write JavaScript code to console log the count of vowels with separate counts for each vowel occurrence. e.g if enter the string “apple” the output should be vowel count:: a:1, e:1, i:0, o:0, u:0. Let’s try to do this in a single iteration i.e.… Read More »Count Vowels in a String with JavaScript

## Program to Evaluate Postfix Expression – LeetCode

• DSA

Given, an arithmetic expression. We need to Evaluate Postfix Expression, also known as Reverse Polish Notation. Operators include /,*,+,- and we will always return a finite result, there won’t be any divide with zero operations. Example What is a Postfix Expression A Postfix Expression or a Reverse Polish Notation is… Read More »Program to Evaluate Postfix Expression – LeetCode

## Balanced Parenthesis Program

• DSA

We have an expression that contains brackets and alphanumeric characters, and we need to check whether the parenthesis are balanced or not. Balanced Parenthesis means an equal number of opening and closing brackets. Example Solution Approach – Using Stack Why Stack Data Structure? Here, our priority is to find if… Read More »Balanced Parenthesis Program

## Anagram in Strings

• DSA

Given, two strings and we need to check if those strings form an anagram. If you are wondering what’s an Anagram? When the characters of one word are obtained from rearranging the letters/characters of another word, they are called anagrams. Example Note: Important!, Anagrams can be a single word or… Read More »Anagram in Strings

## Maximum Occurring Character in a String

• DSA

Given, a String of Characters might be a mix of numbers, alphabets, and other special characters and we need to find the maximum occurring character and to do this we need to count the occurrence of each and every character and then the greatest one will be our answer. Examples… Read More »Maximum Occurring Character in a String