Skip to content

ravinderdasari/improve-performance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

  • All the following tasks can be done without adding any other dependencies
  • Do not modify the unit tests. They will all pass once the code is fixed

Improve-performance

The project contains a service - NumberService. The service has a public method findSmallestDuplicate, which accepts a list of numbers and returns the smallest duplicate or null if there are no duplicates.

Implement the findSmallestDuplicateImproved method so that the unit tests pass. The unit tests assert that:

  1. The number that the new method (findSmallestDuplicateImproved) finds is the same as the slow running method (findSmallestDuplicate)
  2. The new method is at least 1000 times faster than the old one.
  3. Null value is returned if there are no duplicates.

About

NumberService

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages