摘要:
Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s 阅读全文
摘要:
1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input wo 阅读全文
摘要:
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be 阅读全文
摘要:
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur 阅读全文
摘要:
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文
摘要:
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. 使用快慢指针, fast每次前进两 阅读全文
摘要:
136. Single Number Given an array of integers, every element appears twice except for one. Find that single one. Bit: a ^ a = 0; 137. Single Number II 阅读全文
摘要:
62. Unique Paths A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down 阅读全文
摘要:
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example,Given n = 3, You should return the followi 阅读全文
摘要:
Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators a 阅读全文