JavaScript
solution.js
1
Results

Click "Run Code" to test your solution.

Console