7 kyu

maxPossibleScore

722 of 858kkrieger

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: maxPossibleScore({"a": 1, "b": 2, "c": 3}, ["a", "c"]); // 1 * 2 + 2 + 3 * 2 = 10

Arrays
Fundamentals

Stats:

CreatedJul 12, 2017
PublishedJul 12, 2017
Warriors Trained1448
Total Skips18
Total Code Submissions8855
Total Times Completed858
JavaScript Completions722
C# Completions90
Ruby Completions61
Total Stars25
% of votes with a positive feedback rating83% of 189
Total "Very Satisfied" Votes142
Total "Somewhat Satisfied" Votes30
Total "Not Satisfied" Votes17
Total Rank Assessments14
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • kkrieger Avatar
  • smile67 Avatar
  • myjinxin2015 Avatar
  • Souzooka Avatar
  • leesc22 Avatar
  • hobovsky Avatar
Ad