mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-04-03 10:57:52 +08:00
[offers][fix] Fix out of bounds bug when calculating analysis percentile
This commit is contained in:
@@ -200,7 +200,7 @@ const calculatePercentile = (
|
||||
|
||||
if (salary !== lastOfferSalary) {
|
||||
if (salary === offerToCalculateSalary && offerToCalculateIndex === -1) {
|
||||
offerToCalculateIndex = i;
|
||||
offerToCalculateIndex = numberOfNoDuplicateOffers;
|
||||
}
|
||||
numberOfNoDuplicateOffers++;
|
||||
lastOfferSalary = salary;
|
||||
|
||||
Reference in New Issue
Block a user