# Solution

## LeetCode 226 | Invert Binary Tree | Python | Solution

Invert Binary Tree is one of the most popular programming problems. It’s an easy problem. I assume that you have a basic understanding of Binary Tree and Recursion. LeetCode 226 The problem description is straightforward. Simply put, we have to invert a binary tree and then return the root. More precisely, to solve this, we […]

## LeetCode 199 | Binary Tree Right Side View | Python | Solution

If you know about the level order traversal algorithm, finding the right-side view of a binary tree becomes easy for you. This problem is nothing but a simple extended version of that. If you want to know about Level Order Traversal, I will encourage you to read this blog. LeetCode 199 The problem description is

## Two Sum | LeetCode 1 | Python | Solution

LeetCode 1 Read the problem description first and think about the problem. We will be given an integer array and target. Target is also an integer. We have to find two elements out from the given array, where the sum of those two elements has to be equal to the target. After that, we will

## 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

## Reverse Linked List | LeetCode 206 | Python | Solution

LeetCode 206 Reverse Linked List is one of the classic programming problems. The problem description is nothing complicated. We have to reverse the given Linked List and return the reversed list. For example: We can solve this problem in many ways. Before getting into the solution, you can check my blog about the Linked List

## 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

## 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

## 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

Scroll to Top