All Posts

Leetcode 535: Encode and Decode TinyURL

Design a URL shortening system where you can encode a long URL into a shortened URL and decode it back to the original URL. The system should guarantee that the original URL can always be retrieved using the shortened version.

Leetcode 554: Brick Wall

Given a rectangular wall made up of bricks with varying widths, your task is to determine the minimum number of bricks that a vertical line crosses. The line should be drawn such that it does not cross any brick’s edge, and you cannot place the line at the edges of the wall.

Leetcode 560: Subarray Sum Equals K

Given an array nums of integers and an integer k, find the total number of contiguous subarrays whose sum equals k.

Leetcode 567: Permutation in String

Given two strings s1 and s2, return true if s2 contains any permutation of s1 as a substring, otherwise return false. In other words, check if one of the permutations of s1 exists as a substring within s2.

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 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.