Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function arrivingInKathmandu(input) {
- while ((line = input.shift()) !== 'Last note') {
- let [rawName, length, geohash] = line.split(/[\=\<<]/).filter(x => x !== '');
- rawName = rawName.split(/[\!\@\#\$\?]/).join('');
- let name = rawName.match(/[A-Za-z0-9]+/gi).join('');
- if (name !== undefined && length !== undefined && geohash !== undefined && name === rawName
- && Number(length) === geohash.length && Number(length) !== undefined) {
- console.log(`Coordinates found! ${name} -> ${geohash}`);
- } else {
- console.log('Nothing found!');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement