Travis build: 1751 [cron]

This commit is contained in:
30secondsofcode
2018-02-26 20:28:33 +00:00
parent 5fd3f348dc
commit 76b2582c8e
8 changed files with 2062 additions and 1920 deletions

View File

@ -1,9 +1,6 @@
const sortedLastIndex = (arr, n) => {
const isDescending = arr[0] > arr[arr.length - 1];
const index = arr
.map((val, i) => [i, val])
.reverse()
.findIndex(el => (isDescending ? n <= el[1] : n >= el[1]));
const index = arr.reverse().findIndex(el => (isDescending ? n <= el : n >= el));
return index === -1 ? 0 : arr.length - index - 1;
};
module.exports = sortedLastIndex;