摘要: 1 """ 2 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. 3 (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7, 阅读全文
posted @ 2020-02-12 22:33 yawenw 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Implement int sqrt(int x). 3 Compute and return the square root of x, where x is guaranteed to be a non-negative integer. 4 Since the return t 阅读全文
posted @ 2020-02-12 22:32 yawenw 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that 阅读全文
posted @ 2020-02-12 13:16 yawenw 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). 3 The robot can only move either down or righ 阅读全文
posted @ 2020-02-12 11:37 yawenw 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. 3 Exa 阅读全文
posted @ 2020-02-11 23:08 yawenw 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given two strings text1 and text2, return the length of their longest common subsequence. 3 A subsequence of a string is a new string generate 阅读全文
posted @ 2020-02-11 23:07 yawenw 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 BFS遍历题,一遍AC 3 Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. 4 Return the smallest le 阅读全文
posted @ 2020-02-10 15:35 yawenw 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given an N x N grid containing only values 0 and 1, where 0 represents water and 1 represents land, find a water cell such that its distance t 阅读全文
posted @ 2020-02-10 15:32 yawenw 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 层次遍历 3 """ 4 """ 5 Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by lev 阅读全文
posted @ 2020-02-08 20:15 yawenw 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given two binary trees, write a function to check if they are the same or not. 3 Two binary trees are considered the same if they are structur 阅读全文
posted @ 2020-02-08 20:07 yawenw 阅读(140) 评论(0) 推荐(0) 编辑