forked from Automedon/CodeWars-7-kyu-Soluitions
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAlan Partridge III - London.js
More file actions
21 lines (16 loc) · 972 Bytes
/
Copy pathAlan Partridge III - London.js
File metadata and controls
21 lines (16 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
Description:
Ever the learned traveller, Alan Partridge has pretty strong views on London:
"Go to London. I guarantee you'll either be mugged or not appreciated.
Catch the train to London, stopping at Rejection, Disappointment, Backstabbing Central and Shattered Dreams Parkway."
Your job is to check that the provided list of stations contains all of the stops Alan mentions. There will be other stations in the array. Example:
['Rejection', 'Disappointment', 'Backstabbing Central', 'Shattered Dreams Parkway']
If the stations all appear, return 'Smell my cheese you mother!', if not, return 'No, seriously, run. You will miss it.'.
Other katas in this series:
Alan Partridge I - Partridge Watch
Alan Partridge II - Apple Turnover
*/
function alan(x){
const dict=['Rejection', 'Disappointment', 'Backstabbing Central', 'Shattered Dreams Parkway'];
return dict.every(v=>x.includes(v))? 'Smell my cheese you mother!':'No, seriously, run. You will miss it.';
}