Add Binary Leetcode Solution

Problem Statement Given two binary strings a and b, we have to add these two strings and then return the result as a binary string. Binary string are the strings that contains only 0s and 1s. Example a = “11”, b = “1” “100” a = “1010”, b = “1011” “10101” Approach For adding two …

Read more

Valid Palindrome Leetcode Solution

Problem Statement Given a string, we have to determine if it is a palindrome, considering only alphanumeric characters i.e. numbers and alphabets only. We also have to ignore cases for alphabet characters. Example “A man, a plan, a canal: Panama” true Explanation: “AmanaplanacanalPanama”  is a valid palindrome. “race a car” …

Read more

Reverse Vowels of a String Leetcode Solution

Problem Statement In this problem a string is given and we have to reverse only the vowels of this string. Example “hello” “holle” Explanation: before reversing :  “hello” after reversing    :  “holle” “leetcode” “leotcede” Explanation: Approach 1 (Using Stack) We just have to reverse the vowels present in input …

Read more

Roman to Integer Leetcode Solution

In the problem “Roman to Integer”, we are given a string representing some positive integer in its Roman numeral form. Roman numerals are represented by 7 characters that can be converted to integers using the following table: Note: The integer value of the given roman numeral will not exceed or …

Read more

Multiply Strings Leetcode Solution

The problem Multiply Strings Leetcode solution asks us to multiply two strings which are given to us as input. We are required to print or return this result of multiplying to the caller function. So to put it more formally given two strings, find the product of the given strings. …

Read more

Integer to Roman Leetcode Solution

In this problem, we are given an integer and are required to convert into roman numeral. Thus the problem is generally referred to as “Integer to Roman” and this is Integer to Roman Leetcode Solution. If someone does not know about Roman numerals. In the old times, people did not …

Read more

Translate »