Binary Search - Leetcode 704 - Python SolutionHey Everyone, today we will solve how to find a number in a sorted array according to its target using Binary Search. Step-1 Initialize the start pointer at the beginning of the array and the end pointer at the end of the array. def binary_search(num...Sep 13, 2024 · 2 min readkmdshojib.hashnode.dev
Find Middle of a Linked List - Leet code 876 - two pointers approachHey everyone, we will solve how we can find the Middle of the Linked List and solve this problem using a pointers approach. Step 1: Initialize Pointers We are going to initialize the left and right pointers at the beginning of our beginning of our Li...Sep 7, 2024 · 2 min readkmdshojib.hashnode.dev
Find the Student that Will Replace the Chalk - Leet Code 1894 - Python - in three simple stepsHey everyone, Today we will solve Find the Student that Will Replace the Chalk - Leet Code 1894 in three simple steps. Calculate the total chalk needed for one full round Reduce k modulo total_chalk Iterate through the array to find the first stud...Sep 2, 2024 · 1 min readkmdshojib.hashnode.dev
Reverse String in three steps - LeetCode 344 - Two PointersHey everyone, Today we will solve LeetCode 344: Reverse String using two pointers approach. Step 1: Initialize Pointerswe are going to initialize the low at index 0, and the high at the last index. def reverseString(s): low = 0 high = len(s) ...Aug 30, 2024 · 1 min readkmdshojib.hashnode.dev
What is the difference between (==) and (===)?Hello everyone! today we are going to talk about the difference between double(==) and triple(===). so, the double (==) and triple(===) a both are used for comparison, but they behave very differently. Let's see what double(==) offers! const a = 5; c...Oct 19, 2023 · 1 min readkmdshojib.hashnode.dev