mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-04-03 02:48:43 +08:00
[offers][fix] Fix analysis bug that causes percentile to go negative
This commit is contained in:
@@ -199,7 +199,7 @@ const calculatePercentile = (
|
||||
const salary = getSalary(offer, lastOfferSalary);
|
||||
|
||||
if (salary !== lastOfferSalary) {
|
||||
if (salary === offerToCalculateSalary) {
|
||||
if (salary === offerToCalculateSalary && offerToCalculateIndex === -1) {
|
||||
offerToCalculateIndex = i;
|
||||
}
|
||||
numberOfNoDuplicateOffers++;
|
||||
|
||||
Reference in New Issue
Block a user