Apple edges Nvidia in $5 trillion market cap race on AI strategy