摘要:
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 阅读全文
摘要:
Given an integer, write a function to determine if it is a power of two. Hint: 最容易想到的方法是用n反复的去除以2,一直到n变成1。这期间如果出现不能被2整除的数,那么一开始的n就不是2的power. 但是为了满足O(1 阅读全文
摘要:
实现Pow(x, n), 使用二分n的办法进行递归。 阅读全文
摘要:
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 阅读全文
摘要:
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
摘要:
key: build and search Hash table. following up questions: Overflow value for target? 用Hash table记录之间的状态,思想类似DP def twoSum(nums, target): d = {} n = len(nums) res = [] for i in range... 阅读全文
摘要:
Q: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sing 阅读全文
摘要:
Example: Example: 阅读全文