All Posts

Leetcode 606: Construct String from Binary Tree

Given the root node of a binary tree, generate a string representation of the tree following specific formatting rules based on a preorder traversal.

Leetcode 609: Find Duplicate File in System

Given a list of directory paths, each containing file names and their content, return the groups of duplicate files that have the same content.

Leetcode 611: Valid Triangle Number

Given an array of integers, return the number of triplets that can form a valid triangle. A valid triangle is formed when the sum of any two sides is greater than the third side.

Leetcode 621: Task Scheduler

Given a list of tasks and a number n, determine the minimum number of CPU intervals required to complete all tasks, respecting the constraint that the same task must be separated by at least n intervals.

Leetcode 622: Design Circular Queue

Design and implement a Circular Queue. A circular queue is a linear data structure where the operations follow the FIFO principle, and the last position is connected to the first, forming a circle. This design allows better space utilization.

Leetcode 623: Add One Row to Tree

You are given the root of a binary tree, and two integers val and depth. You need to add a row of nodes with value val at the given depth depth. The root node is considered to be at depth 1.