Right now it is like when you are a fisherman and you meet a starwing painter and he asks you for food and you are like: "Listen here dude, i wont give you any fish but ill teach you how to fish.". In short, im working on something totaly out of my league and i need some quick fix for it, i can't afford to learn to understand how it works.
Except that I offer to feed the fisherman and tell him I'll even give him the fish today AND teach him to fish if he can describe why he's in this position in the first place. But the painter storms off to start pestering other fisherman.
I guess i was hopping to get a done function that i could just copy paste, this may sound kind of selfish but i don't realy have any choice here, got like two days to finish this program, therefor no time to do it right.
I'm genuinely curious why you need this and only have 2 days to do it. It doesn't sound like you're in school, so perhaps it's a take-home interview assignment? If so, then you should really get to the solution on your own with guidance rather than just being handed a solution. If I didn't guess right, then please tell me why.
You do have a choice. Two days is PLENTY of time to teach you how to write this function and understand why it works. If you can take 5 minutes of that deadline and explain more details about your situation, I'll be more than happy to give you the fish and teach you how to fish. (provided I agree with the why)