
Leetcode
Cherry_keven
是你的坚持与努力,使你超越了昨天的自己
展开
-
leetcode05. 替换空格
#include <iostream> using namespace std; class Solution { public: string replaceSpace(string s) { int len = s.size(); for (int i = 0; i < len; i++) { if (s[i] == ' ') { s += " "; } } int i = s.size() - 1; for (int j .原创 2021-05-06 21:11:57 · 112 阅读 · 0 评论 -
Leetcode 1. 两数之和 VS下实现
1、构造函数可以没有 2、指向一个数组,就必须有结果 3、VS调试 打断点 开始调试F5 单步F11 右击变量,监控 #include <iostream> #include <vector> #include <string> using namespace std; class Solution { public: vector<int> twoSum(vector<int>& nums, int target) {原创 2021-05-05 21:56:24 · 253 阅读 · 0 评论