Yes, most people don’t realize that an ‘algorithm’ will work forward an backwards.
If you know the result, you can run the numbers backwards to get the original answer................
I was a programmer for over 40 years (operating systems and applications).