Ujjwal Sharmaujjwalsharma.hashnode.dev·Jul 9, 2024Average Waiting time (Simulation based question)Problem link Click here Approach Initially, when the chef is not doing anything and a customer arrives, the waiting time for the customer to get a particular dish ordered is nothing but just the preparation time. Now, let's suppose the chef is prep...Discussujjwalsharma
Carol Dsilvacaroldsillva.hashnode.dev·Jul 4, 2024Day 03 of 100 Days of Code: C++ Basics For DSAI started with DSA yesterday, and I'm currently revising the basics of C++. I found a structured plan/roadmap to learn DSA and I intend to follow it. This is the Strivers A2Z DSA Course/Sheet. It has all the topics in either article form or video for...Discuss100DaysOfCode
Mahbub Alam Masumblog.masum.dev·Jun 24, 2024How to Find the Element that Appears Once in an ArrayFinding the element that appears only once in an array where all other elements appear twice is a common problem in coding interviews and programming challenges. In this article, we'll discuss four approaches to solve this problem: one using a brute ...DiscussArrayDSA
Mahbub Alam Masumblog.masum.dev·Jun 22, 2024How to Find the Maximum Consecutive Ones in an ArrayFinding the maximum number of consecutive 1's in a binary array is a common problem that can be efficiently solved with a linear time algorithm. In this article, we will discuss an optimal approach to solve this problem. Solution: Optimal Approach Th...Discuss·1 likeArrayDSA
Mahbub Alam Masumblog.masum.dev·Jun 21, 2024How to Find the Missing Number in an ArrayIn an array containing numbers from 1 to N, where one number is missing, the goal is to find the missing number. Here, we'll discuss four different methods to achieve this, ranging from brute force to optimal approaches. Solution 1: Brute Force Appro...DiscussArrayDSA
Mahbub Alam Masumblog.masum.dev·Jun 20, 2024Intersection of Two Sorted ArraysFinding the intersection of two sorted arrays is a common problem in coding interviews and programming challenges. In this article, we'll discuss two approaches to solve this problem: one using a brute force approach and another using two-pointers te...DiscussArrayDSA
Mahbub Alam Masumblog.masum.dev·Jun 19, 2024Union of Two Sorted ArraysFinding the union of two sorted arrays involves combining the elements of both arrays without duplicates. This problem can be solved using different approaches, each with its own time and space complexity. In this article, we'll discuss two approache...DiscussArrayDSA
Mahbub Alam Masumblog.masum.dev·Jun 15, 2024How to Move Zeros to the End of an ArrayMoving zeros to the end of an array while maintaining the order of non-zero elements is a common problem in programming. In this article, we'll discuss two approaches to achieve this: one using a temporary array and another using a two-pointers techn...DiscussArrayDSA
Mahbub Alam Masumblog.masum.dev·Jun 15, 2024How to Right Rotate an Array by D PositionsRight rotating an array involves shifting the elements of the array to the right by a specified number of places. In this article, we'll discuss two efficient methods to achieve this rotation. Solution 1: Brute Force Approach (using a Temp Array) Thi...DiscussDSA
Mahbub Alam Masumblog.masum.dev·Jun 15, 2024How to Left Rotate an Array by D PositionsLeft rotating an array involves shifting the elements of the array to the left by a specified number of places. In this article, we'll discuss two efficient methods to achieve this rotation. Solution 1: Brute Force Approach (using a Temp Array) This ...DiscussArrayDSA