Skip to content

Commit 115647d

Browse files
committed
Fix: Fix the prototype miss match in 2048
1 parent 5b8726b commit 115647d

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

2048-Next Greater Numerically Balanced Number/Note.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ const PRECOMPUTED_NUMERICALLY_BALANCED_NUMBERS: Uint32Array = (() => {
167167
*
168168
* Constraints: 0 <= n <= 10^6
169169
*
170-
* @param inputNumber - The given integer.
171-
* @returns The smallest numerically balanced number strictly greater than inputNumber.
172-
* @throws RangeError - If no numerically balanced number exists that is strictly greater than inputNumber.
170+
* @param n - The given integer.
171+
* @returns The smallest numerically balanced number strictly greater than n.
172+
* @throws RangeError - If no numerically balanced number exists that is strictly greater than n.
173173
*/
174-
function nextBeautifulNumber(inputNumber: number): number {
175-
// Binary search to locate the first precomputed number strictly greater than inputNumber
176-
const foundIndex = upperBound(PRECOMPUTED_NUMERICALLY_BALANCED_NUMBERS, inputNumber)
174+
function nextBeautifulNumber(n: number): number {
175+
// Binary search to locate the first precomputed number strictly greater than n
176+
const foundIndex = upperBound(PRECOMPUTED_NUMERICALLY_BALANCED_NUMBERS, n)
177177

178178
// If not found, signal to the caller that the request is out of the supported range
179179
if (foundIndex >= PRECOMPUTED_NUMERICALLY_BALANCED_NUMBERS.length) {
180180
throw new RangeError(
181-
`No numerically balanced number strictly greater than ${inputNumber} exists within the precomputed range.`
181+
`No numerically balanced number strictly greater than ${n} exists within the precomputed range.`
182182
)
183183
}
184184

2048-Next Greater Numerically Balanced Number/answer.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,18 @@ const PRECOMPUTED_NUMERICALLY_BALANCED_NUMBERS: Uint32Array = (() => {
111111
*
112112
* Constraints: 0 <= n <= 10^6
113113
*
114-
* @param inputNumber - The given integer.
115-
* @returns The smallest numerically balanced number strictly greater than inputNumber.
116-
* @throws RangeError - If no numerically balanced number exists that is strictly greater than inputNumber.
114+
* @param n - The given integer.
115+
* @returns The smallest numerically balanced number strictly greater than n.
116+
* @throws RangeError - If no numerically balanced number exists that is strictly greater than n.
117117
*/
118-
function nextBeautifulNumber(inputNumber: number): number {
119-
// Binary search to locate the first precomputed number strictly greater than inputNumber
120-
const foundIndex = upperBound(PRECOMPUTED_NUMERICALLY_BALANCED_NUMBERS, inputNumber)
118+
function nextBeautifulNumber(n: number): number {
119+
// Binary search to locate the first precomputed number strictly greater than n
120+
const foundIndex = upperBound(PRECOMPUTED_NUMERICALLY_BALANCED_NUMBERS, n)
121121

122122
// If not found, signal to the caller that the request is out of the supported range
123123
if (foundIndex >= PRECOMPUTED_NUMERICALLY_BALANCED_NUMBERS.length) {
124124
throw new RangeError(
125-
`No numerically balanced number strictly greater than ${inputNumber} exists within the precomputed range.`
125+
`No numerically balanced number strictly greater than ${n} exists within the precomputed range.`
126126
)
127127
}
128128

0 commit comments

Comments
 (0)