Skip to content

Commit ebcd7a4

Browse files
authored
Merge pull request neetcode-gh#1460 from RHRafi009/main
Create: 58-Length-of-Last-Word.cs
2 parents 32f3f53 + 88d6717 commit ebcd7a4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

csharp/58-Length-of-Last-Word.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public class Solution {
2+
public int LengthOfLastWord(string s) {
3+
s = s.TrimEnd();
4+
string[] arr = s.Split(' ');
5+
return arr[arr.Length - 1].Length;
6+
}
7+
}
8+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy