注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
// We are working on a security system for a badged-access room in our company's building.
// Given an ordered list of employees who used their badge to enter or exit the room, write a function that returns two collections:
// 1. All employees who didn't use their badge while exiting the room – they recorded an enter without a matching exit.
// 2. All employees who didn't use their badge while entering the room – they recorded an exit without a matching enter.
// badge_records = [
// ["Martha", "exit"],
// ["Paul", "enter"],
// ["Martha", "enter"],
// ["Martha", "exit"],
// ["Jennifer", "enter"],
// ["Paul", "enter"],
// ["Curtis", "enter"],
// ["Paul", &t modify main().
* Your core implementation should be in createWorkflowStages().
* There is only one questions for this challenge. It is expected to take about 45 minutes, but you are permitted to use up to two hours.
Clarifications
* The lists in your output should be in precedence order.
* The steps within a given list in your output can be in any order (i.e. [“chop”, “stir”] and [“stir”, “chop”] are equivalent for our purposes).
* Assume all inputs are always sanitized (input can be empty but will not be null, no null/empty/otherwise invalid steps, no circular references, etc.).
|