Problem2 solved in JavaScript
Improved javascript solution for problem 2
Problem 3 solved in JavaScript and Python