摘要: 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. You may comple 阅读全文
posted @ 2019-04-02 21:42 月半榨菜 阅读(109) 评论(0) 推荐(0)
摘要: 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. You may comple 阅读全文
posted @ 2019-04-02 21:36 月半榨菜 阅读(126) 评论(0) 推荐(0)
摘要: Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: E 阅读全文
posted @ 2019-04-02 17:38 月半榨菜 阅读(85) 评论(0) 推荐(0)
摘要: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文
posted @ 2019-04-02 16:36 月半榨菜 阅读(84) 评论(0) 推荐(0)
摘要: Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adja 阅读全文
posted @ 2019-04-02 11:31 月半榨菜 阅读(86) 评论(0) 推荐(0)
摘要: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjac 阅读全文
posted @ 2019-04-02 11:13 月半榨菜 阅读(119) 评论(0) 推荐(0)
摘要: Implement a trie with insert, search, and startsWith methods. Example: Note: You may assume that all inputs are consist of lowercase letters a-z. All 阅读全文
posted @ 2019-04-02 09:53 月半榨菜 阅读(114) 评论(0) 推荐(0)