mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Misc fixes across multiple algorithms (#6912)
Source: Snyk code quality Add scikit-fuzzy to requirements Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
This commit is contained in:
@ -34,12 +34,11 @@ def solution():
|
||||
words = f.readline()
|
||||
|
||||
words = [word.strip('"') for word in words.strip("\r\n").split(",")]
|
||||
words = list(
|
||||
filter(
|
||||
lambda word: word in TRIANGULAR_NUMBERS,
|
||||
(sum(ord(x) - 64 for x in word) for word in words),
|
||||
)
|
||||
)
|
||||
words = [
|
||||
word
|
||||
for word in [sum(ord(x) - 64 for x in word) for word in words]
|
||||
if word in TRIANGULAR_NUMBERS
|
||||
]
|
||||
return len(words)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user