摘要:
Happy NumberWrite an algorithm to determine if a number is happy.A happy number is a number defined by the following process: Starting with any positi... 阅读全文
摘要:
3SumGiven an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum... 阅读全文
摘要:
4SumGiven an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target?Find all unique quadruplets in the array w... 阅读全文
摘要:
Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the... 阅读全文
摘要:
Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return 2147483647ExampleGiven divide... 阅读全文
摘要:
Count of Smaller NumberGive you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) and an query list. Fo... 阅读全文
摘要:
Intersection of Two Linked ListsWrite a program to find the node at which the intersection of two singly linked lists begins.ExampleThe following two ... 阅读全文
摘要:
Find the Missing NumberGiven an array contains N numbers of 0 .. N, find which number doesn't exist in the array.ExampleGiven N = 3 and the array [0, ... 阅读全文
摘要:
Palindrome Linked ListImplement a function to check if a linked list is a palindrome.ExampleGiven 1->2->1, return trueChallengeCould you do it in O(n)... 阅读全文
摘要:
Search a 2D MatrixWrite an efficient algorithm that searches for a value in an m x n matrix.This matrix has the following properties:Integers in each ... 阅读全文