Skip to content

Commit a9139cd

Browse files
committed
replace difficulty numbers with easy/medium/hard text
1 parent 5e87cff commit a9139cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/problems-by-company/company.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ function addCompanyProblems(sortMethod: string) {
172172
solutions.forEach(solution => {
173173
const row = table.insertRow(-1);
174174
row.insertCell(0).innerText = solution.id.toString();
175-
row.insertCell(1).innerText = solution.difficulty?.toString() || 'N/A'; // New column for difficulty
175+
const difficultyText = solution.difficulty === 1 ? 'Easy' : solution.difficulty === 2 ? 'Medium' : 'Hard';
176+
row.insertCell(1).innerText = difficultyText || 'N/A';
176177
row.insertCell(2).innerHTML = `<a href="${solution.url}" target="_blank">${solution.title}</a>`;
177178
row.insertCell(3).innerText = (solution.acceptance ? (solution.acceptance * 100).toFixed(2) + '%' : 'N/A'); // New column for acceptance
178179
// add frequency as a bar
@@ -186,7 +187,6 @@ function addCompanyProblems(sortMethod: string) {
186187
bar.style.borderRadius = '10px';
187188
frequencyCell.appendChild(bar);
188189
}
189-
190190
});
191191
});
192192
}

0 commit comments

Comments
 (0)