Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence

An-Wen Deng
4 次觀看·2024年11月2日

Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence
C++ & Python都有字串的find,用法都類似
split=s.find(' ', split+1)能找到s從index=split+1開始出現' '的第一個的index
-----
C++ & Python both have string find, and their usage is similar.
split=s.find(' ', split+1) can find the first index where ' ' appears in s starting from index=split+1
[codes on Leetcode]https://leetcode.com/problems/circular-sentence/solutions/5995203/use-string-view-find-vs-1-liner-beats-100/
[Leetcode Playlist]https://www.youtube.com/watch?v=B1GQlUN08lk&list=PLYRlUBnWnd5IdDHk2BjqXwesydU17z_xk