Taha Iftikhardexterifti.hashnode.dev·Apr 10, 2024LeeCode - Divide Two Integers || Bit ManipulationLeetCode Problem Link https://www.youtube.com/watch?v=pBD4B1tzgVc Naive Appraoch - Intuition- Initialize a sum variable to track the current total. Initialize a count variable to count the number of times the divisor can be added to the sum wit...DiscussDSA
Taha Iftikhardexterifti.hashnode.dev·Apr 8, 2024LeetCode Single Number - III || Striver's Bit Manipulation Lec 7 || Java, C++, Python CodeLeetCode Problem Link https://www.youtube.com/watch?v=UA5JnV1J2sI Approach - 1 || Brute Force Approach Approach: We use a HashMap to store the frequency of each number in the array. We iterate through the array once to populate the HashMap. The...Discuss·1 likeDSA
Taha Iftikhardexterifti.hashnode.dev·Apr 6, 2024LeetCode Single Number - II || Striver's Bit Manipulatoin Lec- 6 || Java , C++, Python CodeLeetCode Problem https://www.youtube.com/watch?v=5Bb2nqA40JY&list=PLgUwDviBIf0rnqh8QsJaHyIX7KUiaPUv7&index=6 Approach - 1 || Brute Force Approach In brute force approach , simply use a map create a map iterate through the given array and store t...Discuss·1 likeDSA
Akshay Pariharakshayparihar.hashnode.dev·Mar 30, 202420 Coding Patters to Ace coding InterviewsTwo Pointers It is used when we need to find pairs or sub-arrays in an array that satisfy a certain condition, or when we need to find a specific element in a sorted array. Typically, the two pointers advance towards opposite ends of the data structu...Discussdata structure and algorithms
Dhanushdhanushprofile.hashnode.dev·Mar 24, 2024Bit Insertion in JavaStep 1: Create a mask to clear the bits from position A to position B in X. Step 2: Clear the bits in X from position A to position B using the mask Step 3: Left shift Y by A positions to align it with the cleared bits in X Step 4: Merge the modified...Discuss·1 likeJavaJava
Miradil Zeynallimmzeynalli.hashnode.dev·Mar 11, 2024Solving DSA Problems. HackerRank: Winning Lottery TicketProblem statement The SuperBowl Lottery is about to commence, and there are several lottery tickets being sold, and each ticket is identified with a ticket ID. In one of the many winning scenarios in the Superbowl lottery, a winning pair of tickets i...DiscussDSA
Gulshan Kumarperfinsights.hashnode.dev·Feb 1, 2024Find the DifferenceYou are given two strings s and t. String t is generated by random shuffling string s and then add one more letter at a random position. Return the letter that was added to t. LeetCode Problem - 289: Link | Click Here class Solution { // Method t...DiscussJava Solutionsorting
Gulshan Kumarperfinsights.hashnode.dev·Feb 1, 2024Set MismatchYou have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to another number in the set, which results in repetition of one number and loss of another ...DiscussJava Solutionarray
Adityaascendantaditya.hashnode.dev·Jan 24, 2024Roadmap for Mastering Data Structures and Algorithms (DSA)Data Structures are the building blocks of any program. Here's a suggested order to learn them: Data Structures to Practice: 1. Arrays and Strings Find the maximum sum of a subarray: https://leetcode.com/problems/maximum-subarray/ Reverse a string:...Discuss·26 readsdata structures and algorithms
Nitishkumarnitishkumar07.hashnode.dev·Jan 11, 2024Day 1I started a day with Problem of the day in GeeksforGeeks. The coding question was named "Remove K Digits". it is a stack problem. Problem statement: Given a non-negative integer S represented as a string, remove K digits from the number so that the n...Discusspodt