摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Return 0 if the array contains less than 2 el 阅读全文
posted @ 2015-01-19 22:49 Grandyang 阅读(13826) 评论(12) 推荐(1) 编辑
摘要: Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume t 阅读全文
posted @ 2015-01-19 12:54 Grandyang 阅读(26447) 评论(19) 推荐(1) 编辑
摘要: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 阅读全文
posted @ 2015-01-19 09:40 Grandyang 阅读(19510) 评论(7) 推荐(0) 编辑
Fork me on GitHub