This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const list = [ | |
{ name: 'test a', ranking: 3 }, | |
{ name: 'test b', ranking: 7 }, | |
{ name: 'test c', ranking: 8 }, | |
{ name: 'test d', ranking: 2 }, | |
{ name: 'test e', ranking: 5 }, | |
{ name: 'test f', ranking: 2 }, | |
{ name: 'test g', ranking: 6 }, | |
{ name: 'test h', ranking: 7 }, | |
{ name: 'test i', ranking: 9 }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Task: Implement a 'Range Collection' class. | |
// A pair of integers define a range, for example: [1, 5). This range includes integers: 1, 2, 3, and 4. | |
// A range collection is an aggregate of these ranges: [1, 5), [10, 11), [100, 201) | |
/** | |
* RangeCollection class | |
* NOTE: Feel free to add any extra member variables/functions you like. | |
*/ | |
class RangeCollection { | |
constructor() { |
OlderNewer