Edabit Experience Points

Published by er0s in

As you complete questions on Edabit, you gain experience points depending on the difficulty of the question. The points for each difficulty are as follows:

DifficultyExperience Points
Very Easy5XP
Easy10XP
Medium20XP
Hard40XP
Very Hard80XP

Given an object of how many questions a person has completed of each difficulty, return how many experience points they'll have.

Examples

getXP({
  "Very Easy" : 89,
  "Easy" : 77,
  "Medium" : 30,
  "Hard" : 4,
  "Very Hard" : 1
}) ➞ "2055XP"


getXP({
  "Very Easy" : 254,
  "Easy" : 32,
  "Medium" : 65,
  "Hard" : 51,
  "Very Hard" : 34
}) ➞ "7650XP"


getXP({
  "Very Easy" : 11,
  "Easy" : 0,
  "Medium" : 2,
  "Hard" : 0,
  "Very Hard" : 27
}) ➞ "2255XP"

Notes

Return values as a string and make sure to add "XP" to the end.

Watch a quick demo on how Edabit works.