Advertisement
nikunjsoni

1816

Apr 4th, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. class Solution(object):
  2.     def truncateSentence(self, s, k):
  3.         """
  4.        :type s: str
  5.        :type k: int
  6.        :rtype: str
  7.        """
  8.         st = s.split(' ')
  9.         return (" ".join(st[0:k]))
  10.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement