2019年4月16日

摘要: Given an array A, we can perform a pancake flip: We choose some positive integer k <= A.length, then reverse the order of the first k elements of A. W 阅读全文
posted @ 2019-04-16 05:33 一直走在路上 阅读(135) 评论(0) 推荐(0)

2019年4月15日

摘要: In a deck of cards, every card has a unique integer. You can order the deck in any order you want. Initially, all the cards start face down (unreveale 阅读全文
posted @ 2019-04-15 06:52 一直走在路上 阅读(153) 评论(0) 推荐(0)
摘要: Given an array A of integers, a ramp is a tuple (i, j) for which i < j and A[i] <= A[j]. The width of such a ramp is j - i. Find the maximum width of 阅读全文
posted @ 2019-04-15 01:38 一直走在路上 阅读(167) 评论(0) 推荐(0)

2019年4月14日

摘要: Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. We define an array is non-decr 阅读全文
posted @ 2019-04-14 22:05 一直走在路上 阅读(129) 评论(0) 推荐(0)

2019年4月13日

摘要: An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A[j]. A 阅读全文
posted @ 2019-04-13 21:38 一直走在路上 阅读(197) 评论(0) 推荐(0)

2019年4月12日

摘要: Given an array of integers A with even length, return true if and only if it is possible to reorder it such that A[2 * i + 1] = 2 * A[2 * i] for every 阅读全文
posted @ 2019-04-12 08:13 一直走在路上 阅读(111) 评论(0) 推荐(0)

2019年4月11日

摘要: Given an array of integers A, a move consists of choosing any A[i], and incrementing it by 1. Return the least number of moves to make every value in 阅读全文
posted @ 2019-04-11 08:49 一直走在路上 阅读(146) 评论(0) 推荐(0)
摘要: We have an array A of integers, and an array queries of queries. For the i-th query val = queries[i][0], index = queries[i][1], we add val to A[index] 阅读全文
posted @ 2019-04-11 06:07 一直走在路上 阅读(97) 评论(0) 推荐(0)
摘要: On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns. These are given as characters 'R', ' 阅读全文
posted @ 2019-04-11 03:08 一直走在路上 阅读(124) 评论(0) 推荐(0)
摘要: Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K. Example 1: Input: A = [4,5,0,-2,- 阅读全文
posted @ 2019-04-11 01:18 一直走在路上 阅读(108) 评论(0) 推荐(0)

导航