Skip to content

Commit

Permalink
length of last word
Browse files Browse the repository at this point in the history
  • Loading branch information
a-abdellatif98 committed Feb 16, 2022
1 parent e58015f commit 06ae87c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions LengthofLastWord.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def length_of_last_word(s)
x = s.split(" ")
return x.last.length
end

0 comments on commit 06ae87c

Please sign in to comment.