Cut and Dot
If S is longer than K characters, keep the first K and append ...; otherwise print S unchanged.
Input: the first line has S; the second line has K.
Output: the possibly-truncated string.
Constraints:
- 1 ≤ |S| ≤ 104
- 1 ≤ K ≤ 104
Sample Tests
Input 1
hello 3
Output 1
hel...
Input 2
hi 5
Output 2
hi
Discussion (opens after you solve — no spoilers before)
No comments yet.