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