1232. Check If It Is a Straight Line
1232. Check If It Is a Straight Line
Description
You are given an arraycoordinates
, coordinates[i] = [x, y]
, where [x, y]
represents the coordinate of a point. Check if these pointsmake a straight line in the XY plane.
489. Robot Room Cleaner
359. Logger Rate Limiter
480. Sliding Window Median
245. Shortest Word Distance III
245. Shortest Word Distance III
Description
Given an array of strings wordsDict
and two strings that already exist in the array word1
and word2
, return the shortest distance between the occurrence of these two words in the list.
1028. Recover a Tree From Preorder Traversal
1028. Recover a Tree From Preorder Traversal
Description
We run a preorder depth-first search (DFS) on the root
of a binary tree.
311. Sparse Matrix Multiplication
311. Sparse Matrix Multiplication
Description
Given two sparse matrices mat1
of size m x k
and mat2
of size k x n
, return the result of mat1 x mat2
. You may assume that multiplication is always possible.
1443. Minimum Time to Collect All Apples in a Tree
1443. Minimum Time to Collect All Apples in a Tree
Description
Given an undirected tree consisting of n
vertices numbered from 0
to n-1
, which has some apples in their vertices. You spend 1 second to walk over one edge of the tree. Return the minimum time in seconds you have to spend to collect all apples in the tree, starting at vertex 0 and coming back to this vertex.