摘要:
Given a string s and a character c that occurs in s, return an array of integers answer where answer.length == s.length and answer[i] is the shortest 阅读全文
摘要:
We define a harmonious array as an array where the difference between its maximum value and its minimum value is exactly 1. Given an integer array num 阅读全文
摘要:
Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that all its elements lies in [low, hig 阅读全文
摘要:
The numeric value of a lowercase character is defined as its position (1-indexed) in the alphabet, so the numeric value of a is 1, the numeric value o 阅读全文
摘要:
Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109 + 阅读全文
摘要:
You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the heigh 阅读全文
摘要:
Two strings are considered close if you can attain one from the other using the following operations: Operation 1: Swap any two existing characters. F 阅读全文
摘要:
Given an integer array nums and a positive integer k, return the most competitive subsequence of nums of size k. An array's subsequence is a resulting 阅读全文
摘要:
An encoded string S is given. To find and write the decoded string to a tape, the encoded string is read one character at a time and the following ste 阅读全文
摘要:
Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: I 阅读全文