2020年5月18日

lc 数组中的第K个最大元素

摘要: 链接:https://leetcode-cn.com/problems/kth-largest-element-in-an-array/ 代码: class Solution { public: int findKthLargest(vector<int>& nums, int k) { k--; 阅读全文

posted @ 2020-05-18 00:42 FriskyPuppy 阅读(201) 评论(0) 推荐(0) 编辑

lc 买卖股票的最佳时机 II

摘要: 链接:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/ 代码: class Solution { public: int maxProfit(vector<int>& prices) { if(prices.si 阅读全文

posted @ 2020-05-18 00:38 FriskyPuppy 阅读(158) 评论(0) 推荐(0) 编辑

lc 买卖股票的最佳时机

摘要: 链接:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/ 代码: #include<iostream> #include<algorithm> class Solution { public: int maxProfit 阅读全文

posted @ 2020-05-18 00:34 FriskyPuppy 阅读(289) 评论(0) 推荐(0) 编辑

lc 无重复字符的最长子串

摘要: 链接:https://leetcode-cn.com/explore/interview/card/bytedance/242/string/1012/ 代码: #include<algorithm> class Solution { public: int lengthOfLongestSubst 阅读全文

posted @ 2020-05-18 00:21 FriskyPuppy 阅读(156) 评论(0) 推荐(0) 编辑

lc 最长公共前缀

摘要: 链接:https://leetcode-cn.com/explore/interview/card/bytedance/242/string/1014/ 代码: class Solution { public: string longestCommonPrefix(vector<string>& s 阅读全文

posted @ 2020-05-18 00:14 FriskyPuppy 阅读(138) 评论(0) 推荐(0) 编辑

lc 字符串的排列

摘要: 链接:https://leetcode-cn.com/explore/interview/card/bytedance/242/string/1016/ 代码: class Solution { public: bool checkInclusion(string s1, string s2) { 阅读全文

posted @ 2020-05-18 00:13 FriskyPuppy 阅读(173) 评论(0) 推荐(0) 编辑

lc 字符串相乘

摘要: 链接:https://leetcode-cn.com/explore/interview/card/bytedance/242/string/1015/ 代码: #include <iostream> #include <algorithm> using namespace std; class S 阅读全文

posted @ 2020-05-18 00:08 FriskyPuppy 阅读(242) 评论(0) 推荐(0) 编辑

lc 翻转字符串里的单词

摘要: 链接:https://leetcode-cn.com/explore/interview/card/bytedance/242/string/1011/ 代码: class Solution { public: string reverseWords(string s) { int len = s. 阅读全文

posted @ 2020-05-18 00:04 FriskyPuppy 阅读(144) 评论(0) 推荐(0) 编辑

lc 简化路径

摘要: 链接:https://leetcode-cn.com/explore/interview/card/bytedance/242/string/1013/ 代码: #include <stack> class Solution { public: string simplifyPath(string 阅读全文

posted @ 2020-05-18 00:03 FriskyPuppy 阅读(206) 评论(0) 推荐(0) 编辑

导航