Skip to content

Commit 5b1fd5c

Browse files
Update dynamic_programming/narcissistic_number.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 440b37e commit 5b1fd5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dynamic_programming/narcissistic_number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def find_narcissistic_numbers(limit: int) -> list[int]:
5858

5959
narcissistic_nums = []
6060

61-
# Memoization: cache[num_digits][digit] = digit^num_digits
61+
# Memoization: cache[(power, digit)] = digit^power
6262
# This avoids recalculating the same power for different numbers
6363
power_cache: dict[tuple[int, int], int] = {}
6464

0 commit comments

Comments
 (0)