摘要:
原题链接在这里:https://leetcode.com/problems/valid-parentheses/ 题目: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine 阅读全文
posted @ 2015-08-18 12:02
Dylan_Java_NYC
阅读(168)
评论(0)
推荐(0)
摘要:
原题链接在这里:https://leetcode.com/problems/implement-queue-using-stacks/ 题目: Implement the following operations of a queue using stacks. push(x) -- Push el 阅读全文
posted @ 2015-08-18 11:35
Dylan_Java_NYC
阅读(219)
评论(0)
推荐(0)
摘要:
原题链接在这里:https://leetcode.com/problems/implement-stack-using-queues/ 题目: Implement the following operations of a stack using queues. push(x) -- Push el 阅读全文
posted @ 2015-08-18 10:57
Dylan_Java_NYC
阅读(264)
评论(0)
推荐(0)
摘要:
这是一道面试亚马逊时的题目,要求Time O(n). 我刚开始想的是算出所有的数的总product,再去除以对应位置的元素,但这种做法的问题是若该位置为0,就会报错。到网上搜了下,才知道,原来有这种做法。e.g. arr = {0,1,2,3},生成两个array: upArr = {1,arr[0... 阅读全文
posted @ 2015-08-18 04:09
Dylan_Java_NYC
阅读(171)
评论(0)
推荐(0)
摘要:
原题链接在这里:https://leetcode.com/problems/multiply-strings/ 题目: Given two non-negative integers num1 and num2 represented as strings, return the product o 阅读全文
posted @ 2015-08-18 03:32
Dylan_Java_NYC
阅读(295)
评论(0)
推荐(0)
浙公网安备 33010602011771号