Tag: C#

  • Remove duplicates from-sorted array-2 [LC150]

    Hello friends, Today we’re going to discuss another Leetcode DSA problem about removing duplicates from-sorted array. link- https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/description/ Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the elements should be kept the same. To change the length of the array in some languages, you need to…

  • Algorithm to get max profit from stock transactions [LC150]

    Hello friends, Today let’s go over the algorithm to find maximum profit out of stock buy and sell. Let’s first understand the problem statement. You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit. If you cannot achieve any profit, return…