My Blog List

[Leetcode Solution]Length of Last Word

Analysis 

  • One pass algorithm
  • Use two counters denote the length of last word and current word separately. When '0' or '\0' occurs, let last equal to current

Note

Code


No comments:

Post a Comment

Enter you comment