I'm strongly against the idea of sharing solutions to LeetCode problems, but I'm also lazy and don't want to re-solve the same problems over and over again. So I'm sharing my solutions here, but I'm not going to explain them. If you're looking for explanations, you're in the wrong place.
You are should not submit these solutions as your own. If you do, you're a bad person.