ByteDance cofounder Zhang Yiming has become China’s richest man as investors bet on companies with AI potential.