All Posts

Leetcode 2034: Stock Price Fluctuation

You are given a stream of stock price records, where each record contains a timestamp and the corresponding price of the stock. The records may not be in order, and some records may contain errors that need to be corrected. Your task is to design an algorithm that updates the stock price at a given timestamp, finds the current price at the latest timestamp, and also finds the maximum and minimum prices the stock has been based on the current records.

Leetcode 2526: Find Consecutive Integers from a Data Stream

You need to implement a DataStream class that processes a stream of integers and checks whether the last k integers in the stream are equal to a specified value.