# String

## Largest Odd Number in String | LeetCode 1903 | Python | Solution

LeetCode 1903 It’s a simple problem. We have to return the largest odd number from the given string. If we check odd numbers from the last, we will get the result. If a number is odd, we can say that all the numbers from start to including this number are odd. Suppose the given number […]

## Ransom Note | LeetCode 383 | Python | Solution

LeetCode 383 Problem Overview Ransom Note is a pretty common programming problem. The problem description is concise and understandable. So, this problem says that we will be given two strings (ransomNote and magazine). In short, we have to return True if all the characters of the ransomNote are in the magazine string. Otherwise, False. For

## Maximum Number of Words Found in Sentences | LeetCode 2114 | LeetCode | Python | Solution

LeetCode 2124 This one is one of the easy problems on LeetCode. To solve this problem, mainly you have to know how to split a sentence based on spaces and count array elements. If you know the basics of Python, this will not be a big deal for you. You can solve this problem. I

## Group Anagrams | LeetCode 49 | Python | Solution

LeetCode 49 If you know how to valid anagram, this one will be easier for you to solve. You can check this to know about it (Valid Anagram). I assume that you already know how to valid anagram. So, to solve this problem, we do the same thing. But this time, we have to group

## Valid Anagram | LeetCode 242 | Python | Solution

Click here to see this problem on LeetCode. This problem’s difficulty level is easy. Problem Overview Simple problem. From the given two strings, we have to check the first one is an anagram of the second one. If it’s not true, then we will return False. Otherwise, True. According to Wikipedia: An Anagram is a

## First Unique Character in a String | LeetCode 387 | Python | Solution

This problem is pretty straightforward. Click here to see the problem. Problem Overview The problem description is one line and pretty simple. It says that we have to find the first unique character from a string and return the index of that character. In the given String, all characters will be English lowercase letters. Suppose

## Remove All Occurrences of a Substring | LeetCode 1910 | Python | Solution

Click here to see the problem details. Problem Overview We will be given a string (s) and a substring (part). We have to remove all occurrences from the string based on the given substring. We will continue to remove until all the occurrences of the substring are removed. Each time we have to remove the

## Truncate Sentence | LeetCode 1816 | Python | Solution

Here is the problem link. Problem Overview This is an easy problem, and it’s basically a string-related problem. I hope you already read the problem description from the given link. So we will be given a string and an integer. The given string is basically a sentence which is a list of words separated by

## Shuffle String | LeetCode 1528 | Python | Solution

Click here to see the problem details. Problem Overview This problem is quite simple. We will be given a string (s) and an array (indices) that is the same length as the string. All of the integers of the array are unique, and of course, all the integers will be less or equal to the

## 10 Useful String Methods in Python

Introduction Generally, a string is consists of one or more characters. These characters can be the alphabet, numbers, etc. In most cases, we need to manipulate string as per our need. It is tedious to do this manually. That’s why general-purpose programming languages come with so many useful methods to make our life easier. Similarly,

Scroll to Top