@@ -225,8 +225,31 @@ function rebuildTable() {
225225 solutions . forEach ( ( solution ) => {
226226 const row = table . insertRow ( - 1 ) ;
227227 row . insertCell ( 0 ) . innerText = solution . id . toString ( ) ;
228- const difficultyText = solution . difficulty === 1 ? 'Easy' : solution . difficulty === 2 ? 'Medium' : 'Hard' ;
229- row . insertCell ( 1 ) . innerText = difficultyText || 'N/A' ;
228+
229+ // Get the difficulty level
230+ const difficulty = solution . difficulty ;
231+ const difficultyCell = row . insertCell ( 1 ) ;
232+ let difficultyText = '' ;
233+ let color = '' ;
234+
235+ // Define the difficulty text and background color
236+ if ( difficulty === 1 ) {
237+ difficultyText = 'Easy' ;
238+ color = 'lightgreen' ;
239+ } else if ( difficulty === 2 ) {
240+ difficultyText = 'Medium' ;
241+ color = 'orange' ;
242+ } else {
243+ difficultyText = 'Hard' ;
244+ color = 'red' ;
245+ }
246+
247+ difficultyCell . innerText = difficultyText || 'N/A' ;
248+ difficultyCell . style . color = color ;
249+ difficultyCell . style . fontWeight = 'bold' ;
250+ difficultyCell . style . fontSize = '10px' ;
251+ difficultyCell . style . borderRadius = '5px' ; // Apply border radius
252+
230253 row . insertCell ( 2 ) . innerHTML = `<a href="${ solution . url } " target="_blank">${ solution . title } </a>` ;
231254 row . insertCell ( 3 ) . innerText = ( solution . acceptance ? ( solution . acceptance * 100 ) . toFixed ( 2 ) + '%' : 'N/A' ) ; // New column for acceptance
232255
@@ -244,7 +267,6 @@ function rebuildTable() {
244267}
245268
246269
247-
248270// Keep track of the sorting order for each column
249271const sortOrders = {
250272 '#' : false ,
0 commit comments