上一页 1 ··· 56 57 58 59 60 61 62 63 64 ··· 80 下一页
摘要: Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文
posted @ 2014-11-23 12:49 匡子语 阅读(221) 评论(0) 推荐(0)
摘要: 之前写过栈的,以为队列的也一样,结果一点都不一样。写了好久啊。因为栈是后进先出,先进去的数字不会影响后面的数字;而队列是先进先出,后进去的会受先进入的数字的影响。比如: (先) 1 9 3 8 4 (后) 这样的序列栈存储 1 9 就可以了,因为9弹出后,自然 1 就是最大的队列... 阅读全文
posted @ 2014-11-21 22:48 匡子语 阅读(457) 评论(0) 推荐(0)
摘要: You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb... 阅读全文
posted @ 2014-11-21 16:26 匡子语 阅读(215) 评论(0) 推荐(0)
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2014-11-21 15:58 匡子语 阅读(238) 评论(0) 推荐(0)
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2014-11-20 16:43 匡子语 阅读(181) 评论(0) 推荐(0)
摘要: 题目:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction ... 阅读全文
posted @ 2014-11-20 16:32 匡子语 阅读(191) 评论(0) 推荐(0)
摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp... 阅读全文
posted @ 2014-11-20 16:00 匡子语 阅读(213) 评论(0) 推荐(0)
摘要: 题目:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complex... 阅读全文
posted @ 2014-11-20 14:35 匡子语 阅读(199) 评论(0) 推荐(0)
摘要: 题目:就是判断已有的数字是否冲突无效,若无效返回flase 有效返回true 不要求sudo可解用了char型的数字,并且空格用‘.'来表示的。思路:只要分别判断横向 竖向 3*3小块中的数字是否有重复或者无效就可以了 就是单纯的麻烦 不难#include#includeusing namespac... 阅读全文
posted @ 2014-11-20 11:32 匡子语 阅读(229) 评论(0) 推荐(0)
摘要: Given 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 two nu... 阅读全文
posted @ 2014-11-20 10:37 匡子语 阅读(198) 评论(0) 推荐(0)
上一页 1 ··· 56 57 58 59 60 61 62 63 64 ··· 80 下一页