Skip to content

Commit 690a85f

Browse files
committed
Runtime: 116 ms (Top 36.48%) | Memory: 43.8 MB (Top 80.69%)
1 parent edb98f5 commit 690a85f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/algorithms/S/Second Largest Digit in a String/Second Largest Digit in a String.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 116 ms (Top 36.48%) | Memory: 43.8 MB (Top 80.69%)
12
/**
23
* @param {string} s
34
* @return {number}
@@ -12,7 +13,7 @@ var secondHighest = function(s) {
1213
var res = new Set(digits) //turn the array into a set, to remove duplicates
1314
if(res.size <=1){
1415
//if the set is sized 1, then there is no second largest digit
15-
return -1
16+
return -1
1617
}
1718
else{
1819
//otherwise, the second largest digit would be at index 1 (because we sorted the array into descending order)

0 commit comments

Comments
 (0)