top hotest n algorithm