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 […]

# Category: LeetCode

## 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 […]

## Merge Two Sorted Lists | LeetCode 21 | Python | Solution

Click here to see the problem details. Problem Overview The problem description is pretty straightforward. We are given two sorted Linked List. And we have to merge those given Lists into one sorted list. That’s the problem. Suppose our given two lists are 1 -> 3 and 2 -> 4. And the result will be […]

## Insert into a Binary Search Tree | LeetCode 701 | Python | Solution

Click here to see the problem details. Read the problem details first. Concept This is clearly a Tree related problem and a medium-type problem. In my sense, it’s not that difficult if you have a basic concept about BST (Binary Search Tree). BST is also a Binary Tree. So what is a Binary Search Tree? […]

## Check if the Sentence Is Pangram | LeetCode 1832 | Python | Solution

Click here to see the problem details. It’s an easy LeetCode problem with straightforward problem details. In a simple word, we will be given a sentence to check it is Pangram or not. So, what is Pangram? According to the problem description, “A pangram is a sentence where every letter of the English alphabet appears […]

## Valid Palindrome | LeetCode 125 | Python | Solution

Click here to see the problem details on LeetCode. Before solving this problem, we have to know about palindrome. According to the definition of Wikipedia: A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam or racecar. Wikipedia The problem says that we […]

## Sum of Unique Elements | LeetCode 1748 | Python | Solution

Click here to see the problem details. Problem Overview This one is a very much simple problem. We have to find out the sum of all the unique values from an integer array. Nothing else, and we don’t have to check anything extra. Let’s see an example. In the above example, it’s clear that 5 […]

## Reverse Only Letters | LeetCode 917 | Python | Solution

Click here to see the problem details. Problem Overview The problem description is pretty precise. It says that we have to return the reverse version of the given string. But we can only reverse letters. Characters that are not a letter stay in the same place. Only letters will change their position. Let’s see an […]

## Range Sum of BST | LeetCode 938 | Python | Solution

Click here to see the problem on LeetCode. A simple Tree related problem and description is pretty straightforward. We have to return the sum of values of all nodes with a value in the range. The range is actually a minimum integer and a maximum integer. If a node value is in the range, we […]