2019年9月24日
摘要: 问题描述: 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 阅读全文
posted @ 2019-09-24 14:55 狂奔的蜗牛163 阅读(260) 评论(0) 推荐(0) 编辑
  2019年9月23日
摘要: 问题描述: 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 阅读全文
posted @ 2019-09-23 15:30 狂奔的蜗牛163 阅读(244) 评论(0) 推荐(0) 编辑
  2019年9月20日
摘要: 问题描述: 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 阅读全文
posted @ 2019-09-20 14:36 狂奔的蜗牛163 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 问题描述: 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 阅读全文
posted @ 2019-09-20 10:26 狂奔的蜗牛163 阅读(290) 评论(0) 推荐(0) 编辑
  2019年9月18日
摘要: 问题描述: 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算 阅读全文
posted @ 2019-09-18 10:38 狂奔的蜗牛163 阅读(237) 评论(0) 推荐(0) 编辑
  2019年9月16日
摘要: 问题描述: 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  阅读全文
posted @ 2019-09-16 09:09 狂奔的蜗牛163 阅读(297) 评论(0) 推荐(0) 编辑
  2019年8月7日
摘要: 问题描述: 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 阅读全文
posted @ 2019-08-07 20:14 狂奔的蜗牛163 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 问题描述: 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 阅读全文
posted @ 2019-08-07 11:27 狂奔的蜗牛163 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 问题描述: 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 阅读全文
posted @ 2019-08-07 10:37 狂奔的蜗牛163 阅读(339) 评论(0) 推荐(0) 编辑
  2019年8月6日
摘要: 问题描述: 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 阅读全文
posted @ 2019-08-06 14:08 狂奔的蜗牛163 阅读(252) 评论(0) 推荐(0) 编辑