上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: 5. 最长回文子串 题目描述: 解法一(暴力求解): class Solution {public: string longestPalindrome(string s) { int n=s.size(); string r... 阅读全文
posted @ 2019-09-06 17:16 DH_HUSTer 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 121. 买卖股票的最佳时机 题目描述: 解法一: class Solution {public: int maxProfit(vector& prices) { int n=prices.size(); if(nminp)... 阅读全文
posted @ 2019-09-05 19:32 DH_HUSTer 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 162. 寻找峰值 题目描述: 解法一(迭代): class Solution {public: int findPeakElement(vector& nums) { int left=0,right=nums.size()-1; ... 阅读全文
posted @ 2019-09-04 13:00 DH_HUSTer 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 解法: class Solution {public: vector twoSum(vector& nums, int target) { unordered_map record; vector res; ... 阅读全文
posted @ 2019-09-03 16:39 DH_HUSTer 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 解法: class Solution {public: double findMedianSortedArrays(vector& nums1, vector& nums2) { if(nums1.size()>nums2.s... 阅读全文
posted @ 2019-09-03 16:32 DH_HUSTer 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 解法: class Solution {public: int maxArea(vector& height) { int n=height.size(); int right=n-1,left=0; ... 阅读全文
posted @ 2019-09-03 10:07 DH_HUSTer 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 解法一: class Solution {public: int maxCoins(vector& nums) { int n=nums.size(); vector> dp(n+2,vector(n+2,0))... 阅读全文
posted @ 2019-09-03 09:10 DH_HUSTer 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 解法: class Solution {public: int lengthOfLongestSubstring(string s) { int n = s.size(); if(n dp(128, -1); ... 阅读全文
posted @ 2019-09-02 18:23 DH_HUSTer 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 解法: class Solution {public: int mincostTickets(vector& days, vector& costs) { int n=days.size(); vector dp... 阅读全文
posted @ 2019-09-02 17:04 DH_HUSTer 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 解法一(递归): class Solution {public: int coinChange(vector& coins, int amount) { if(amount==0) return 0; int r... 阅读全文
posted @ 2019-09-02 15:46 DH_HUSTer 阅读(14) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 13 下一页