摘要: Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? Analysis: 1. Use slow+fast pointe 阅读全文
posted @ 2016-09-12 14:20 LiBlog 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. Exampl 阅读全文
posted @ 2016-09-12 14:04 LiBlog 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the 阅读全文
posted @ 2016-09-12 12:58 LiBlog 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given 阅读全文
posted @ 2016-09-12 10:44 LiBlog 阅读(569) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number m 阅读全文
posted @ 2016-09-12 09:10 LiBlog 阅读(663) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed n 阅读全文
posted @ 2016-09-12 08:37 LiBlog 阅读(128) 评论(0) 推荐(0) 编辑