package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev
# README
58. Length of Last Word
Solution idea
首先,从后往前扫,找到last word's last character;
然后,从last character出发往前扫,找到 empty space just right before last word's first character;
last word长度等于两者相减.
Time complexity = $O(n)$