Find the each word length in an string and combine them
Problem to find the each word length in an string and combine them.
Example-1:
Input : s = "welcome to crazy" Output : 725
Example-2:
Input : s = "my crazy coding" Output : 256
Solution
n = "welcome to crazy" n = n.split() d = "" for i in range(len(n)): d += str(len(n[i])) print(d)
Output
725