It's not a solution at all. It's a transfer: It gives your problems to other people, and then gives them new problems on top of it.
I used to think that suicide was just the most selfish thing a person can do, because it's all about bringing the end to your own suffering without thinking about how it affects the people you leave behind, and throws away all the potential good you could have done. My view has softened a bit to make room for compassion for those who are suffering from depression or terminal illnesses, but I still think there is no bigger waste than to throw away your precious life. Especially so if you think it'll solve any of your problems.
In Buddhism, all existence is like being stuck in a washing machine with endless rinse cycles: you get beat up over and over again, but you never get to the dryer by yourself; the whole load needs to go together. I now see that suicide isn't just selfish in thinking someone can escape their own problems, but it's also futile because they're just going back into the rinse, to be reborn over and over again to deal with the karma they created by killing themself.
Imagine killing yourself and then realizing that not only did you NOT end your problems and suffering, but you have prolonged it and set yourself back on the path to liberation.
Well, in other religions like Christianity the idea of the afterlife is that you get this one shot at life and if you do the right thing you go spend the rest of eternity in bliss, or if you do the wrong thing (sin too much or commit a cardinal sin) you'll suffer in hell forever after. In my opinion, they beat their followers over the head with this idea, with both the carrot AND the stick of an eternal afterlife, to encourage or more often scare them into doing what the church considers the "right thing" in this life.
In Buddhism, to put it simply, being born a human is a precious gift, and it is considered a big mistake to throw that gift away. To be human is an opportunity to practice compassion, to process karma (the circumstances brought up by your past deeds in this and previous lives) and to help lessen the suffering of other sentient beings, and help them process their karma as well. Being human is particularly special because because we have the ability to choose our actions and not just act out of instinct or reactivity. Every decision we make either brings us closer to liberation, or pushes us further away from it, but short of enlightenment there is no way to get off the roller coaster of life and rebirth. If you kill yourself, it may take a whole lot of suffering and rebirths, and an extremely long time, before you're given another opportunity like this. Best not to waste it and realize your mistake too late.