Skip to content

Latest commit

 

History

History

01-basic-cs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Basic CS

There is a database of users and their hats at './database.json'.

Tasks

  1. Find the total sum of the top-3 most selling hats. You can use lodash/underscore (recommended)
  2. What is the complexity in O() notation of time and space? Complete the comment with the right answer.

IMPORTANT: Find a balance between performance and legibility.

Example:

Imagine the following (taken from the real database):

Hat(7adbc650-2a5e-4e59-b88f-97377e0b7e34) sold 7.
Hat(872f5fc4-515f-416d-9ec6-3488da2bd74a) sold 6.
Hat(048d8fbf-7653-461f-a59c-68c73b8855e5) sold 7.
Hat(32266d28-5092-4a69-afb3-90fafd46e04a) sold 9.

-> Expected result: 9 + 7 + 7 => 23