摘要: Description: The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated 阅读全文
posted @ 2019-08-23 18:13 CodingYM 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Description: Let's call an array A a mountain if the following properties hold: A.length >= 3 There exists some 0 < i < A.length - 1 such that A[0] < 阅读全文
posted @ 2019-08-23 18:00 CodingYM 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Description: Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of 阅读全文
posted @ 2019-08-23 17:55 CodingYM 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Description: Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. Sort the elements of arr1 s 阅读全文
posted @ 2019-08-23 17:07 CodingYM 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Description: Given an array A of integers, return true if and only if it is a valid mountain array. Recall that A is a mountain array if and only if: 阅读全文
posted @ 2019-08-23 15:24 CodingYM 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Description: Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example 1: Input: 16 Output: true Example 2: Inp 阅读全文
posted @ 2019-08-23 10:05 CodingYM 阅读(105) 评论(0) 推荐(0) 编辑