Draft

doubleValue

Description:

You're a teacher preparing a test for your students. Each question is worth some number of points. Some of the questions are new to the students, while others are questions they have already seen and practiced. Your scoring system doubles the value of new questions. Your job is to determine the maximum possible score.

Write a function doubleValue that accepts 1) an object of questions (as keys) and points (values) and 2) an array of new questions. The function should return the test's maximum possible score as an integer, where questions that are new are worth double points.

You can assume that all questions are unique. Questions are case sensitive.

Example: doubleValue({"a": 1, "b": 2, "c": 3}, ["a", "c"]); // 1 * 2 + 2 + 3 * 2 = 10

Arrays

More By Author:

Check out these other kata created by kkrieger

Stats:

CreatedJul 11, 2017
Warriors Trained5
Total Skips0
Total Code Submissions8
Total Times Completed3
JavaScript Completions3
Total Stars0
% of votes with a positive feedback rating75% of 2
Total "Very Satisfied" Votes1
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes0
Total Rank Assessments2
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • kkrieger Avatar
Ad