Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { getInput } = require('./utils')
- async function main() {
- const data = await getInput('https://pastebin.com/raw/PkDeVV6L')
- let input = data.split(/\r?\n/)
- const steps = 'qwertyuiopasdfghjklzxcvbnm'.split('')
- .reduce((acc, item) => {
- acc[item.toUpperCase()] = []
- return acc
- }, {})
- input.forEach(line => {
- const data = line.split(' ')
- steps[data[1]].push(data[7])
- })
- let start = null
- Object.keys(steps).forEach(key => {
- if (!steps[key].length) {
- start = key
- }
- })
- console.log(steps)
- }
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement