+ 2
There are more than enough examples on the playground, e.g.
https://code.sololearn.com/c67jLoabdFL4/?ref=app
https://code.sololearn.com/cppfD8Cwkuud/?ref=app
https://code.sololearn.com/cp1Rgo4og1o8/?ref=app
https://code.sololearn.com/cwdQxoCCZF5G/?ref=app
If you need help in creating one yourself, you should probably link your code and explain where you are stuck.