All Posts

Leetcode 624: Maximum Distance in Arrays

You are given m sorted arrays. Your task is to pick two integers, each from a different array, and calculate the maximum distance between them, where the distance is defined as the absolute difference of the two numbers.

Leetcode 633: Sum of Square Numbers

Given a non-negative integer c, determine if there exist two non-negative integers a and b such that a^2 + b^2 = c.

Leetcode 636: Exclusive Time of Functions

You are given a list of logs representing the execution of n functions on a single-threaded CPU. Each log contains a function’s ID, whether the function has started or ended, and the timestamp of the event. The goal is to calculate the exclusive time of each function, which is the total time the function spends executing, excluding the time spent on other nested function calls.

Leetcode 638: Shopping Offers

In a store, there are n items available for sale, each with a given price. You are also given a list of special offers where you can buy multiple items at a discounted price. Your task is to determine the minimum total price to purchase the required quantities of each item, while utilizing the special offers optimally. You can use any offer as many times as you like, but cannot buy more items than you need.

Leetcode 640: Solve the Equation

Given an equation with a variable ‘x’ and basic arithmetic operations (’+’, ‘-’), find the value of ‘x’. The equation might have a solution, no solution, or infinite solutions. Your task is to return the correct result in the form of a string.

Leetcode 641: Design Circular Deque

Design a data structure that simulates a circular double-ended queue (deque) with a fixed maximum size. Implement the MyCircularDeque class with methods for inserting, deleting, and accessing elements at both ends of the deque.