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
| const ar = [10, 20, 20, 10, 10, 30, 50, 10, 20]; | |
| const getPairs = (n, ar) => { | |
| let pairs = 0, i = 0; | |
| ar.sort((a, b) => a - b); | |
| while (i < n) { | |
| const count = ar.filter(item => item === ar[i]).length; | |
| if (count >= 2) { |
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
| /** | |
| Example Code for developer position application | |
| Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
| For this code I'll use JS (es6) running in NodeJS v11 | |
| Instructions: |
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
| const xtreme_math = require("../../ceutek/deunitek/xtreme-math"); | |
| const math = new xtreme_math(3); | |
| console.log(math.square); // resultado: 9. |
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
| const xtreme_math = require("../../ceutek/deunitek/xtreme-math"); | |
| const math = new xtreme_math(3); | |
| console.log(math.square); // resultado: 9. |
NewerOlder