摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 1: You may assume that the array 阅读全文
posted @ 2018-01-20 21:37 A-Little-Nut 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 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 steps. Y 阅读全文
posted @ 2018-01-20 21:15 A-Little-Nut 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2018-01-20 20:50 A-Little-Nut 阅读(366) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2018-01-20 20:44 A-Little-Nut 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [ 2,1, 3,4, 1,2, 阅读全文
posted @ 2018-01-20 20:36 A-Little-Nut 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off th 阅读全文
posted @ 2018-01-20 19:53 A-Little-Nut 阅读(471) 评论(0) 推荐(0) 编辑