Samsung Electronics was once the dominant player in a type of semiconductor known as memory, putting it in a great position to capitalize on the boom of artificial intelligence.