Skip to content

Instantly share code, notes, and snippets.

@dengjonathan
Created February 16, 2017 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dengjonathan/98a350086af2457d0bd0523c952e55e2 to your computer and use it in GitHub Desktop.
Save dengjonathan/98a350086af2457d0bd0523c952e55e2 to your computer and use it in GitHub Desktop.
dengjonathan
/*
You have a defined set of activities you can be doing during your job search
process. Each activity has a cost (time that it takes you to complete the activity)
and each activity provides some value (XP, or experience points,
that will increase your chances of finding a job).
Write a function that maximizes XP for a given input of time. Try to make your
solution as efficient as possible.
*/
const ACTIVITIES = [
{name: 'side-project', time: 10, xp: 20},
{name: 'algorithms', time: 3, xp: 5},
{name: 'networking', time: 1, xp: 0.5},
{name: 'exercise', time: 2, xp: 1.5},
{name: 'systems design', time: 4, xp: 4},
{name: 'making CSS codepens', time: 3, xp: 4}
];
/**
* Returns array of type string with names of activites that maximize XP
* @param {number} time
*/
const findJob = time => {
/* How do I optimize this?!!! */
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment