To beat the market in recent years, many investors applied a simple strategy: Load up on the biggest US technology stocks.