摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2019-11-20 11:24 xuan_abc 阅读(116) 评论(0) 推荐(0)
摘要: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1, 2, 3 ], [ 4, 5, 6 ], 阅读全文
posted @ 2019-11-20 11:02 xuan_abc 阅读(160) 评论(0) 推荐(0)
摘要: Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is tha 阅读全文
posted @ 2019-11-20 10:41 xuan_abc 阅读(259) 评论(0) 推荐(0)