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

Delete the Middle Node of a Linked List | LeetCode 2095 | Python | Solution

LeetCode 2095 Before moving into the problem, we need to know how to delete a node from a linked list. If you don’t know about Linked List, you can read my article about it (Linked List). To delete a node, we need to keep track previous node of it. We will use the formula: previous.next

Kth Largest Element in an Array | LeetCode 215 | Python | Solution

LeetCode 215 From an integer array, we have to find the kth largest element. I assume that you already know about the sorting algorithms. We all know how to access an element from an array. If we sort it in descending order, the kth position will be k-1. We all know that an array index

Guess Number Higher or Lower | LeetCode 374 | Python | Solution

Click here to see the problem on LeetCode. This problem is all about Binary Search. If you know about Binary Search Algorithm, you can solve this problem. In binary search, we search for a value from the mid. Generally, we know the searching value before starting the search. And based on that, we can decide

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

Binary Tree | Data Structure

I have written a blog about the tree data structure overview. If you don’t know about tree data structure, click here to see my blog. In this blog, we will be going to know about Binary Tree. I hope you will get some idea of it. A binary tree is a type of tree. But

Basic Programming Concept for Beginner (Python)

Intro I believe computer programming is one of the most beautiful things in this universe. And we can learn it for free. We can do so many awesome things using this skill. For that, we have to invest time in it. And no doubt, this one blog post doesn’t make someone expert in programming. Here,

Move Zeroes | LeetCode 283 | Python | Solution

Click here to see the problem details on LeetCode. Problem Overview This problem’s difficulty level is easy. The problem description is straightforward. In an integer array, we have to move all 0’s to the end of it. And maintain the relative order of other elements. Suppose we have an array [2, 0, 1] as an

Majority Element | LeetCode 169 | Python | Solution

Click here to see the problem details on LeetCode. Solution Simple problem. We need to find out the majority element from an integer array.Suppose we have an array: [5, 5, 1, 2, 5, 1, 3, 5, 5]. In this array, the number 5 appears five times. And it’s the majority element of the array. The

Find First and Last Position of Element in Sorted Array | LeetCode 34 | Python | Solution

Click here to see the problem details on LeetCode. Problem Overview We will be given an integer array (sorted in no-decreasing order) and an integer. We have to find the position of the given integer from the Array. But there is a trick. That is, we have to find the first and last position of