pls show complete/detailed solution for an upvote. Thank you. and…