Artificial intelligence (AI) was one of the driving themes in the market in 2024, powering a number of stocks to new highs.