All Posts

Leetcode 720: Longest Word in Dictionary

Given an array of strings words, return the longest word in the list that can be built progressively one character at a time by other words in the list.

Leetcode 721: Accounts Merge

You are given a list of accounts, where each account consists of a name and a list of emails. Merge accounts that share common emails, and return the merged accounts in the format: name followed by sorted emails.

Leetcode 722: Remove Comments

You are given a C++ program represented as an array of strings, where each string corresponds to a line of code. Your task is to remove all comments from the code. The two types of comments in C++ are line comments (//) and block comments (/* … */). After removing comments, return the modified code as an array of strings, excluding any empty lines.

Leetcode 724: Find Pivot Index

Given an array of integers, find the pivot index where the sum of elements to the left equals the sum of elements to the right.

Leetcode 729: My Calendar I

You are implementing a calendar application where you can add events. Each event has a start time and end time represented by a half-open interval [start, end). An event can only be added if it does not overlap with existing events in the calendar. Return true if the event can be booked successfully, and false if it causes a conflict.

Leetcode 731: My Calendar II

You are implementing a calendar system where you can add events. Each event is represented by a start time and an end time, defined as a half-open interval [startTime, endTime). You need to ensure that no more than two events overlap at any given time, or else return false. Your task is to implement a class, MyCalendarTwo, that will book events while preventing triple bookings.