- 博客(12)
- 收藏
- 关注
原创 《leetcode-php》一次股票交易的最大收益
假设你有一个数组,其中第i个元素是某只股票在第i天的价格。如果你最多只能完成一笔交易(即买一股和卖一股股票),设计一个算法来求最大利润。Say you have an array for which the i th element is the price of a given stock on day i.If you were only permitted to complete...
2019-08-18 14:06:55 252
原创 《leetcode-php》求一组股票趋势的最高收益
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 as many transactions as you like (ie, buy one ...
2019-08-18 13:50:02 148
原创 《leetcode-php》获取最多两次交易股票的最大收益
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 at mosttwotransactions.Note:You may no...
2019-08-18 13:06:21 603
原创 《leetcode-php》求二叉树中最大的路径和
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Return6.在二叉树中找一条...
2019-08-18 10:39:16 177
原创 《leetcode-php》判断一个语句中的字母和数字组成的字符串是否是回文串
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama"is a palindrome."race a car"is not a pali...
2019-08-12 21:22:30 162
原创 《leetcode-php》给出头尾和字典,求拼接的最短长度
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Only one letter can be changed at a time Each int...
2019-08-10 00:14:16 102
原创 《leetcode-php》给出头尾和字典,求拼接的最短路径
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be changed at a time Each intermedia...
2019-08-08 20:31:36 141
原创 《leetcode-php》找出数组中最长的连续串长度
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is[1, 2, 3, 4]...
2019-08-08 18:21:26 360
原创 《leetcode-php》二叉树从根到叶组成的数求和
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which represents the number123.Find the total sum o...
2019-08-08 17:55:26 157
原创 《leetcode-php》将二维数组中X包围的内部全部变成X
Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounded region .For example,X X X XX O O XX X O XX O...
2019-08-08 16:58:13 550
原创 《leetcode-php》列出字符串分割为回文串的所有形式
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s ="aab",Return [ ["aa","b"],...
2019-08-06 23:31:48 173
原创 《leetcode-php》分割字符串为回文串的最少分割次数
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s ="aab",Return 1 si...
2019-08-06 00:09:07 230
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人