Add solutions to 3 problems

Implemented in JavaScript