linear time shared strings