Pretty much every first-world country other than the USA has at least partially solved it. Social safety nets, regulation of utilities/public goods (education for example), and a guaranteed standard of living.
On this theory, they shut down mental health institutions. Now what happens is mostly that jails serve as ill-suited, ad-hoc mental health institutions. Turns out making things worse without having a plan doesn't always have salutary results.