Don't know how to do what exactly? Have you made any effort to break the problem down into smaller parts at all? I don't know how to build a house but, if I wanted to do it, I wouldn't just ask someone how to build a house. I'd break it down into parts and then those parts into smaller parts. I'd then tackle each part individually, researching each part, trying to implement the ones I could and then asking for help with only the specific parts I needed help with and each one individually. That's what you should be doing here.
The first thing to do with any programming problem is to forget that it's a programming problem. If you had been asked to do this manually, with pen and paper, I'll wager that you could do it. If you could it, then you could describe it. You could write out a list of steps that someone else could follow to do it too. That list of steps is the solution to your problem. You need to come up with that first. Once you have that solution, only then should you think about how to implement it in code. We can help with that last part but you should already have a solution to implement. If you don't then you haven't really tried.
I'm not having a go at you specifically because lots of people are the same. They expect to be able to pluck code out of the air without knowing, at a fine-grained level, what that code is actually supposed to do and when they can't, they expect others to tell them what to do. You need to think about what the code needs to do first and then write the code to do it. If you can't tell me, step by step, what your code needs to do then you haven't given it enough thought yet. As I said, you can come up with those steps without considering it a programming problem so lack of programming experience is no issue.