Sort by Solved/Unsolved Questions in Category

I had the same question but didn’t quite understand how to make it happen. Where do I add this script?
Would it possible to have a configuration button or setting checkbox to enable sorting by solved?