归档 2017年12月

题目描述：

LeetCode 745. Prefix and Suffix Search

Given many `words`, `words[i]` has weight `i`.

Design a class `WordFilter` that supports one function, `WordFilter.f(String prefix, String suffix)`. It will return the word with given `prefix` and `suffix` with ...

题目描述：

LeetCode 742. Closest Leaf in a Binary Tree

Given a binary tree where every node has a unique value, and a target key `k`, find the closest leaf node to target `k` in the tree.

A node is called ...

题目描述：

LeetCode 743. Network Delay Time

There are `N` network nodes, labelled `1` to `N`.

Given `times`, a list of travel times as directed edges `times[i] = (u, v, w)`, where `u` is the source node, `v` is the target ...

题目描述：

LeetCode 744. Find Smallest Letter Greater Than Target

Given a list of sorted characters `letters` containing only lowercase letters, and given a target letter `target`, find the smallest element in the list that is larger than the given target ...

题目描述：

LeetCode 740. Delete and Earn

Given an array `nums` of integers, you can perform operations on the array.

In each operation, you pick any `nums[i]` and delete it to earn `nums[i]` points. After, you must delete every ...