随笔分类 -  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 阅读全文
posted @ 2017-03-31 22:15 朝研行歌 阅读(170) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-03-30 22:12 朝研行歌 阅读(126) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-03-28 22:05 朝研行歌 阅读(189) 评论(0) 推荐(0) 编辑
摘要:Description Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2, 阅读全文
posted @ 2017-03-27 15:23 朝研行歌 阅读(151) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-03-02 11:33 朝研行歌 阅读(190) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-03-01 11:43 朝研行歌 阅读(123) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-09-15 19:48 朝研行歌 阅读(147) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-03-14 11:39 朝研行歌 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Description The "Hamming distance" between two integers is the number of positions at which the corresponding bits are different. Given two integers a 阅读全文
posted @ 2016-03-07 11:18 朝研行歌 阅读(135) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-03-01 11:37 朝研行歌 阅读(277) 评论(0) 推荐(0) 编辑