Expected help from experienced programmers [edited]
It would be better if you attempt to write the algorithm yourself. Just write out all the steps it would take without a computer and then you will have an algorithm that you can attempt to code.
You can post your algorithm and we can review to give you pointers on how to improve it.
We are hear to teach you how to program and not just to give you the answer.
It looked so pretty without the last few words … uncalled for aggression
BTW - this was my first post & perhaps last visit - if the attitude continues Also if you read carefully, I requested for explanation & NOT answer. Thank you & happy holidays!
There is no attitude from me. Part of coding is learning how to break down a problem into smaller pieces. It takes practice to write algorithms. We have no idea what programming level you are at currently, so it would be difficult to explain how to solve this problem if you are not at a certain level.
All I asked before is that you attempt to write the algorithm first and we can take a look at it and see if it would solve the problem. 90% of writing code is getting the algorithm correct before writing a single line of code.
We are happy to help guide you, but as I stated before, we are not going to do the work for you.