A linearly computable measure of string complexity