leetcode 58. Length of Last Word

这道题主要要注意string 末尾有很多空格的情况,C++ 里面空格的判断是用单引号,顺便学习一下revese 需要#include #include<algorithm> class Solution { public: int lengthOfLastWord(string s) { int num = s.size(); if (num==0)
相关文章
相关标签/搜索