题目描述:
LeetCode 854. K-Similar Strings
Strings A
and B
are K
-similar (for some non-negative integer K
) if we can swap the positions of two letters in A
exactly K
times so that the resulting string equals B
.
Given two ...
LeetCode OJ is a platform for preparing technical coding interviews.
LeetCode 854. K-Similar Strings
Strings A
and B
are K
-similar (for some non-negative integer K
) if we can swap the positions of two letters in A
exactly K
times so that the resulting string equals B
.
Given two ...
In an exam room, there are N
seats in a single row, numbered 0, 1, 2, ..., N-1
.
When a student enters the room, they must sit in the seat that maximizes the distance to the ...
N
cars are going to the same destination along a one lane road. The destination is target
miles away.
Each car i
has a constant speed speed[i]
(in miles per hour), and ...
LeetCode 847. Shortest Path Visiting All Nodes
An undirected, connected graph of N nodes (labeled 0, 1, 2, ..., N-1
) is given as graph
.
graph.length = N
, and j != i
is in the list graph[i]
exactly once, if and ...
LeetCode 845. Longest Mountain in Array
Let's call any (contiguous) subarray B (of A) a mountain if the following properties hold:
B.length >= 3
0 < i < B.length - 1
such that B[0] < ...