随笔分类 - ACM
LeetCode, LintCode, etc.
摘要:Description Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. Yo
阅读全文
摘要:Description Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. Yo
阅读全文
摘要:Description Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one
阅读全文
摘要:Description Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,
阅读全文
摘要:Discription You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their
阅读全文
摘要:Description You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct way
阅读全文
摘要:Description Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lis
阅读全文
摘要:Discription Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 Note: The input is assumed to be a 32-bit signe
阅读全文
摘要:Description The "Hamming distance" between two integers is the number of positions at which the corresponding bits are different. Given two integers a
阅读全文
摘要:Discription 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 w
阅读全文