Any chest pain arising on exertion and subsiding at rest is mostly due to coronary artery disease.
I would suggest a TMT and Echo earliest possible.
Till then do not try to test your heart for your mental satisfaction.
You are too young to get a coronary disease but now a days we are seeing it in your age too.
So a medical attention is prudent at your stage.
Next Steps
Cardiac related pain are mostly in centre of chest or left arm shoulder or neck. Patient feel tightness and heavinesses.
You had sharp pain which is unlikely. Still I advice for a TMT and ECHO because of the pattern of appearance and disappearance of your pain.