problems with different Big-O complexity