VISHWANATH T Svishwanathts.hashnode.dev·Dec 19, 2024Solving 'Final Array State After K Multiplication Operations' : Leetcode SolutionIn this article, we will discuss a solution to the LeetCode problem "Final Array State After K Multiplication Operations". This problem challenges us to repeatedly multiply the smallest element in an array by a given multiplier and return the final s...leetcode
Himanshu Goyaldsa-patterns-prefix-sum-with-hashmap.hashnode.dev·Dec 17, 2024DSA Patterns: Prefix Sum with Hash Map Technique ✨✨✨Welcome to the first article in our DSA Patterns series, where we discuss commonly used patterns to solve coding problems, particularly for interviews. In this blog, we will break down the Prefix Sum with Hash Map technique—a powerful approach for so...dsapatterns
VISHWANATH T Svishwanathts.hashnode.dev·Dec 16, 2024Maximum Depth of a Binary Tree : Leetcode Solution.Introduction The depth of a binary tree is one of the fundamental properties used to understand its structure. Calculating the maximum depth of a binary tree involves determining the longest path from the root node to a leaf node. This article explai...Python
VISHWANATH T Svishwanathts.hashnode.dev·Dec 15, 2024Checking if a Binary Tree is Symmetric : Leetcode Solution.Introduction Symmetry in binary trees is a common topic in computer science. A tree is symmetric if the left and right subtrees are mirror images of each other. This article explains how to check if a binary tree is symmetric using recursion in Pytho...Python
VISHWANATH T Svishwanathts.hashnode.dev·Dec 15, 2024Comparing Two Binary Trees for Equality : Leetcode Solution.Introduction Binary trees are a fundamental data structure in computer science. One common problem is determining whether two binary trees are identical. Identical trees have the same structure and node values. This article discusses a Python solutio...Python
VISHWANATH T Svishwanathts.hashnode.dev·Dec 15, 2024In-order Traversal of a Binary Tree Using Recursion : Leetcode SolutionIntroduction Binary tree traversal is a fundamental concept in computer science. One common traversal method is Inorder traversal, where the nodes are visited in the order: left subtree, root, and right subtree. This article explains a Python solutio...Python
VISHWANATH T Svishwanathts.hashnode.dev·Dec 15, 2024Merging Two Sorted Arrays In-Place : Leetcode SolutionIntroduction Merging two sorted arrays is a common programming problem, especially in scenarios where memory optimization is critical. This article presents a Python solution to merge two sorted arrays in-place using a two-pointer approach. The solut...Python
VISHWANATH T Svishwanathts.hashnode.dev·Dec 14, 2024Efficient Iterative Solution for Climbing Stairs Problem in Python : Leetcode SolutionIntuition The problem is essentially about finding the number of distinct ways to climb n stairs, where you can take either 1 or 2 steps at a time. Observing the pattern, we see that this problem is related to the Fibonacci sequence, where each numbe...Python
VISHWANATH T Svishwanathts.hashnode.dev·Dec 14, 2024How to Solve the Square Root of X Using Python's Binary SearchIntuition To find the square root of a number x, we need the largest integer n such that (n^2 \leq x). Since the square root is monotonic (i.e., increasing as x increases), binary search is a natural choice to efficiently find the answer without test...Python
VISHWANATH T Svishwanathts.hashnode.dev·Dec 14, 2024How to Find the Length of the Last Word in a String: Python Solution for Leetcode.Intuition The problem requires finding the length of the last word in a string. A word is a sequence of non-space characters. My first thought was to remove any extra spaces from the input, split the string into words, and return the length of the la...Python