diff --git a/ismail/1.dart b/ismail/1.dart index e69de29..da20dc7 100644 --- a/ismail/1.dart +++ b/ismail/1.dart @@ -0,0 +1,13 @@ +void main() { + final s = " fly me to the moon "; + final solution = Solution(); + final output = solution.lengthOfLastWord(s); + print("Output: $output"); +} + +class Solution { + int lengthOfLastWord(String s) { + final List splite = s.trim().split(' '); + return splite.last.length; + } +}