All Posts
Leetcode 1695: Maximum Erasure Value
You are given an array of positive integers. Your task is to erase a subarray containing only unique elements and return the maximum sum of the subarray you can erase.
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 1701: Average Waiting Time
A restaurant with a single chef serves customers. Each customer arrives at a specific time and waits for the chef to prepare their order. The chef can only serve one customer at a time and prepares orders in the order they were received. The goal is to calculate the average waiting time of all customers. The waiting time of a customer is the time between their arrival and when they receive their order.
Leetcode 1702: Maximum Binary String After Change
You are given a binary string consisting of only ‘0’s and ‘1’s. You can perform two types of operations on this string any number of times:
- Operation 1: Replace any occurrence of the substring ‘00’ with ‘10’.
- Operation 2: Replace any occurrence of the substring ‘10’ with ‘01’.
Your goal is to apply these operations and transform the binary string into the largest possible binary string in terms of its decimal value. A string ‘x’ is considered larger than string ‘y’ if the decimal value of ‘x’ is greater than that of ‘y’.