摘要:
问题描述: You are standing at position 0 on an infinite number line. There is a goal at position target. On each move, you can either go left or right. Du 阅读全文
摘要:
问题描述: On a staircase, the i-th step has some non-negative cost cost[i]assigned (0 indexed). Once you pay the cost, you can either climb one or two ste 阅读全文
摘要:
问题描述: Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct el 阅读全文
摘要:
问题描述: Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's 阅读全文
摘要:
问题描述: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: 思路: 考虑BFS算法,因为这是第一次碰到BFS算 阅读全文
摘要:
问题描述: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of 阅读全文
摘要:
问题描述: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and je 阅读全文
摘要:
问题描述: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the qua 阅读全文
摘要:
问题描述: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not 阅读全文
摘要:
问题描述: Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example, given a 3-ary 阅读全文