Truncate a string-freecodecamp算法题目

NoSuchKey