The Ethics of Artificial Intelligence: Challenges and Solutions