No should share his/her Accepted solution during live contest.
However if someone shares an accepted solution during live contest to his friends or public telegram channels, good people should feed the code to plagiarism checker[currently we don't have such functionality on codeforces [user:MikeMirzayanov]].
The plagiarism checker will easily find the original author and other people who copied the code. It is similar to hacking post contest but here we hack during live contest. There should be reward for first plag finder.
This will surely discourage solution sharing during live contest.