Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
language: node_js
node_js:
- "6"
- "8"
#Travis-CI Caching
cache:
directories:
-node_modules

addons:
chrome: stable

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
dist: xenial
services:
-xvfb

before_install:
npm install karma-cli -g
34 changes: 34 additions & 0 deletions quz/quz.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
*/
function dcate(A, B) {
/** Fill in here **/
let len = A.toString().match(/\d/g).length,
p = A,
i;
for(i = 0; i < len; i++) {
if(p.tail !== null) {
p = p.tail;
} else {
p.tail = B;
}
}
return A;
}

/**
Expand All @@ -24,4 +35,27 @@ function dcate(A, B) {
*/
function sub(L, start, len) {
/** Fill in here **/
let length = L.toString().match(/\d/g).length,
p = l,
R = {
head: null,
tail: null
},
s = R,
i = 0;
while(i < length && i <= start + len - 1) {
if(i === start) {
R.head = p.head;
} else if(i > start) {
s.tail = {
head: p.head,
tail: null
}
s = s.tail;
}
p.tail && (p = p.tail);
i++;
}
R.toString = L.toString;
return R;
}