All Posts

Leetcode 918: Maximum Sum Circular Subarray

You are given a circular integer array nums of length n. A circular array means that the end of the array connects back to the beginning. Your task is to find the maximum possible sum of a non-empty subarray of nums, which can wrap around the array. Formally, you need to find the maximum sum of a subarray where the subarray can either be within the linear array or it can wrap around from the end to the beginning.

Leetcode 1438: Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

Given an array of integers nums and a positive integer limit, determine the length of the longest subarray where the absolute difference between the minimum and maximum elements is less than or equal to limit.

Leetcode 1696: Jump Game VI

You are given a 0-indexed integer array ’nums’ and an integer ‘k’. You start at index 0 and can jump up to ‘k’ steps forward at a time. Your task is to find the maximum sum of elements you can get by jumping to the last index, visiting subarrays of unique elements.

Leetcode 2762: Continuous Subarrays

You are given a 0-indexed integer array ’nums’. A subarray of ’nums’ is called continuous if the absolute difference between any two elements in the subarray is less than or equal to 2. Return the total number of continuous subarrays.

Leetcode 2944: Minimum Number of Coins for Fruits

You are given a list of integers ‘prices’, where each element ‘prices[i]’ represents the cost to purchase the ‘i’-th fruit. If you buy the ‘i’-th fruit at prices[i] coins, you get all subsequent fruits for free. Your task is to determine the minimum number of coins required to purchase all the fruits.