摘要: Reverse bits of a given 32 bits unsigned integer. Example 1: Example 2: Note: Note that in some languages such as Java, there is no unsigned integer t 阅读全文
posted @ 2019-06-12 14:44 lpomeloz 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Output: [5,6,7,1,2,3,4] 阅读全文
posted @ 2019-06-12 11:16 lpomeloz 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given a column title as appear in an Excel sheet, return its corresponding column number. 题目大意: 根据给定规则,1对应A,2对应B,...,26对应Z,27对应AZ,...。求正整数对应的字符串。 理 解: 阅读全文
posted @ 2019-06-11 16:30 lpomeloz 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 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-06-11 16:08 lpomeloz 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: Example 1: Example 2: Example 3: 题目大意: 根据给定规 阅读全文
posted @ 2019-06-11 14:51 lpomeloz 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2019-06-11 12:38 lpomeloz 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins. 题目大意: 给定两个链表,找到它们的第一个公共节点并返回。 理 解: 从第一个公共节点开始,两链表后面的节点都是 阅读全文
posted @ 2019-06-11 10:54 lpomeloz 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack.pop() -- Remove 阅读全文
posted @ 2019-06-10 20:00 lpomeloz 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi 阅读全文
posted @ 2019-06-10 19:09 lpomeloz 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti 阅读全文
posted @ 2019-06-10 18:05 lpomeloz 阅读(81) 评论(0) 推荐(0) 编辑