Based on your logic here,

if there is a tip: A - B - C - D, and ABC < MIN_LENGTH_TO_KEEP but ABCD > MIN_LENGTH_TO_KEEP,
this logic doesn't remove ABC, from my understanding. Correct me if I am wrong.