-
-
Notifications
You must be signed in to change notification settings - Fork 633
/
Copy pathtrain-driver.js
57 lines (52 loc) · 1.79 KB
/
train-driver.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// @ts-check
//
// The line above enables type checking for this file. Various IDEs interpret
// the @ts-check directive. It will give you helpful autocompletion when
// implementing this exercise.
/**
* Return each Wagons id in form of an array.
*
* @param {number[]} eachWagonsID
* @returns {number[]} each Wagons Wiegth
*/
export function getListOfWagons(eachWagonsID) {
throw new Error('Please implement the getListOfWagons function');
}
/**
* Reorder the array of wagons by moving the first 2 wagons to the end of the array.
*
* @param {number[]} eachWagonsID
* @returns {number[]} reorderd list of wagons
*/
export function fixListOfWagons(eachWagonsID) {
throw new Error('Please implement the fixListOfWagons function');
}
/**
* Fixes the array of wagons by inserting an array of wagons after the first element in eachWagonsID.
*
* @param {number[]} eachWagonsID
* @param {number[]} missingWagons
* @returns {number[]} corrected list of wagons
*/
export function correctListOfWagons(eachWagonsID, missingWagons) {
throw new Error('Please implement the correctListOfWagons function');
}
/**
* Extend route information by adding another object
*
* @param {Record<string, string>} route
* @param {Record<string, string>} moreRouteInformation
* @returns {Record<string, string>} extended route information
*/
export function extendRouteInformation(route, moreRouteInformation) {
throw new Error('Please implement the extendRouteInformation function');
}
/**
* Separate arrival time from the route information object
*
* @param {Record<string, string>} route
* @returns {[string, Record<string, string>]} array with arrival time and object without arrival time
*/
export function separateTimeOfArrival(route) {
throw new Error('Please implement the separateTimeOfArrival function');
}