上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: For a non-negative integer X, the array-form of X is an array of its digits in left to right order. For example, if X = 1231, then the array form is [ 阅读全文
posted @ 2020-07-13 23:22 whatyouthink 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (from most-significant-bit to least-si 阅读全文
posted @ 2020-07-13 21:14 whatyouthink 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. 最大连续子段和,经典动态规 阅读全文
posted @ 2020-07-08 19:37 whatyouthink 阅读(95) 评论(0) 推荐(0) 编辑
摘要: In a list of songs, the i-th song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in seconds is 阅读全文
posted @ 2020-07-08 13:53 whatyouthink 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another ar 阅读全文
posted @ 2020-07-07 19:54 whatyouthink 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that elements beyond 阅读全文
posted @ 2020-07-07 14:50 whatyouthink 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. 只额外开O(k)的空间,那就开一个 阅读全文
posted @ 2020-07-07 14:10 whatyouthink 阅读(96) 评论(0) 推荐(0) 编辑
摘要: In a string S of lowercase letters, these letters form consecutive groups of the same character. For example, a string like S = "abbxxxxzyy" has the g 阅读全文
posted @ 2020-07-07 13:49 whatyouthink 阅读(78) 评论(0) 推荐(0) 编辑
摘要: Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the ave 阅读全文
posted @ 2020-07-07 13:38 whatyouthink 阅读(73) 评论(0) 推荐(0) 编辑
摘要: Tic-tac-toe is played by two players A and B on a 3 x 3 grid. Here are the rules of Tic-Tac-Toe: Players take turns placing characters into empty squa 阅读全文
posted @ 2020-07-06 20:19 whatyouthink 阅读(113) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页