[CentOS] [OT] stable algorithm with complexity O(n)