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
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
language: node_js
node_js:
- "6"
- "10"

addons:
chrome: stable

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

before_install:
npm install karma-cli -g
20 changes: 20 additions & 0 deletions quz/quz.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
*/
function dcate(A, B) {
/** Fill in here **/
let currList = A
while (currList.tail !== null) {
currList = currList.tail;
}
currList.tail = B;
return A;
}

/**
Expand All @@ -24,4 +30,18 @@ function dcate(A, B) {
*/
function sub(L, start, len) {
/** Fill in here **/
if (!L || !(/(^[0-9]\d*$)/.test(start)) || !(/(^[0-9]\d*$)/.test(len))) throw new Error('param error');
let newList = [],
subLen = 0,
currList = L,
currIndex = 0
do {
if (currIndex >= start){
newList.push(currList.head);
subLen++;
}
currList = currList.tail;
currIndex++;
} while (len !== subLen && currList !== null);
return new List.list(newList);
}