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...2 min read·kmdshojib.hashnode.devSep 13, 2024
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...2 min read·kmdshojib.hashnode.devSep 7, 2024
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...1 min read·kmdshojib.hashnode.devSep 2, 2024
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) ...1 min read·kmdshojib.hashnode.devAug 30, 2024
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...1 min read·kmdshojib.hashnode.devOct 19, 2023