Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr-Vol committed Jan 22, 2024
1 parent 90bfadd commit 2d4a737
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/inverseRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
*/

function inverseRobot(robot) {
// write code here
const result = {};

for (const key in robot) {
if (result[robot[key]]) {
return null;
}

result[robot[key]] = key;
}

return result;
}

module.exports = inverseRobot;

0 comments on commit 2d4a737

Please sign in to comment.