Last word



Problem to find the length of last word in the given string.



Example-1:


Input    : s = "Welcome to mycrazycoding"
Output   : 13 


Example-2:


Input    : s = "I love python"
Output   : 6 







Solution





s = "Welcome to mycrazycoding"

a = s.split()

if(len(a)==0):

    print(0)

else:

    b = len(a[-1])

    print(b)



Output



13