We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ad7952 commit 156ca8eCopy full SHA for 156ca8e
2021/day-08/display.js
@@ -28,7 +28,6 @@
28
// })
29
// }
30
31
-const alphabetical = (a, b) => a - b
32
33
/**
34
* Takes a string of scrambled codes and deduces which codes correspond
@@ -41,7 +40,7 @@ const descrambleSignal = (data) => {
41
40
console.debug('2021-day-08 descrambleSignal()')
42
43
const scrambledCodes = data.split(' ')
44
- .map((code) => code.split('').sort(alphabetical)) // Convert each code to alphabetized arrays
+ .map((code) => code.split('').sort()) // Convert each code to alphabetized arrays
45
const segmentCodes = Array(7) // For caching the identified segment codes as we find them
46
const sortedCodes = Array(10) // For caching the identified number codes as we find them
47
0 commit comments