LeetCode
LeetCode: 1079. Letter Tile Possibilities 解題紀錄
題目
You have n
tiles
, where each tile has one letter tiles[i]
printed on it.
Return the number of possible non-empty sequences of letters you can make using the letters printed on those tiles
.
LeetCode: 108. Convert Sorted Array to Binary Search Tree 解題紀錄
題目
Given an integer array nums
where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.
LeetCode: 2870-Minimum Number of Operations to Make Array Empty 解題紀錄
題目
You are given a 0-indexed array nums
consisting of positive integers.
There are two types of operations that you can apply on the array any number of times:
Read More »LeetCode: 2870-Minimum Number of Operations to Make Array Empty 解題紀錄LeetCode: 1637 Widest Vetical Area Between Two Points Containing No Points 解題紀錄
題目
Given n
points
on a 2D plane where points[i] = [xi, yi]
, Return the widest vertical area between two points such that no points are inside the area.
LeetCode: 2706-Buy Two Chocolates 解題紀錄
題目
You are given an integer array prices
representing the prices of various chocolates in a store. You are also given a single integer money
, which represents your initial amount of money.
LeetCode: 661-Image Smoother 解題紀錄
題目
An image smoother is a filter of the size 3 x 3
that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nine cells in the blue smoother). If one or more of the surrounding cells of a cell is not present, we do not consider it in the average (i.e., the average of the four cells in the red smoother).
LeetCode: 2352-Design a Food Rating System 解題紀錄
題目
Design a food rating system that can do the following:
- Modify the rating of a food item listed in the system.
- Return the highest-rated food item for a type of cuisine in the system.
LeetCode: 242-Valid Anagram 解題紀錄
題目
Given two strings s
and t
, return true
if t
is an anagram of s
, and false
otherwise.