摘要: 1 """ 2 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were insert 阅读全文
posted @ 2020-02-12 22:34 yawenw 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(104) 评论(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 阅读(234) 评论(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 阅读(177) 评论(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 阅读(140) 评论(0) 推荐(0) 编辑