Last active
September 7, 2017 02:41
-
-
Save nguyenhuumy/ba2f74da0181dba21de86eb043161864 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(A) { | |
// write your code in JavaScript (Node.js 6.4.0) | |
function Klass(index, array) { | |
this._index = index; | |
this._array = array; | |
} | |
Klass.prototype = { | |
value: function () { | |
return this._array[this._index]; | |
} | |
} | |
T = []; | |
for (i = 0; i < A.length; i++) { | |
T.push(new Klass(i, A)); | |
} | |
return T; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment