Skip to content

Commit 993a76b

Browse files
committed
fix freq not showing correct values
1 parent a9139cd commit 993a76b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/problems-by-company/company.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,10 @@ function addCompanyProblems(sortMethod: string) {
149149
difficulty: correspondingLeetcodeProblem?.difficulty_lvl, // Add difficulty
150150
acceptance: correspondingLeetcodeProblem?.acceptance, // Add acceptance
151151
});
152-
});
153-
}
154152

155-
// Check if companyProblems is an array before proceeding
156-
if (Array.isArray(companyProblems)) {
157-
companyProblems.forEach((problem) => {
158-
solutions.push({
159-
id: problem.id,
160-
title: problem.title,
161-
url: `https://leetcode.com/problems/${problem.title.replace(/\s/g, '-')}/`,
162-
frequency: problem.freq_alltime,
163-
});
153+
// Update min and max frequency
154+
if (problem.freq_alltime < minFrequency) minFrequency = problem.freq_alltime;
155+
if (problem.freq_alltime > maxFrequency) maxFrequency = problem.freq_alltime;
164156
});
165157
}
166158

0 commit comments

Comments
 (0)