All Posts

Leetcode 1400: Construct K Palindrome Strings

You are given a string s and an integer k. Your task is to determine whether it’s possible to use all the characters in the string s to construct exactly k palindromic strings.

Leetcode 1410: HTML Entity Parser

You are tasked with decoding a string that contains HTML entities. The HTML entities represent special characters like quotation marks, ampersands, greater-than signs, etc. You need to replace the HTML entities with their respective characters.

Leetcode 1418: Display Table of Food Orders in a Restaurant

Given a list of customer orders in a restaurant, return a table where each row represents a table number and the columns represent the number of food items ordered at that table, sorted in lexicographical order.

Leetcode 1436: Destination City

You are given an array paths where each element represents a pair of cities [cityAi, cityBi], indicating a direct route from cityAi to cityBi. Your task is to find the destination city, which is the city without any outgoing path to another city.

Leetcode 1442: Count Triplets That Can Form Two Arrays of Equal XOR

You are given an array of integers arr. We want to find the number of triplets (i, j, k) where 0 <= i < j <= k < arr.length, such that the bitwise XOR of elements between indices i and j-1 (inclusive) equals the bitwise XOR of elements between indices j and k (inclusive).

Leetcode 1443: Minimum Time to Collect All Apples in a Tree

You are given an undirected tree with n vertices numbered from 0 to n-1. Some vertices in this tree contain apples. Each edge in the tree requires 1 second to traverse. Starting at vertex 0, determine the minimum time required to collect all apples and return to vertex 0. The tree structure is described by the array edges, where edges[i] = [ai, bi] indicates an edge between vertices ai and bi. Additionally, the array hasApple specifies whether a vertex contains an apple (true) or not (false).