Skip to content

Conversation

@vslyubimov
Copy link
Owner

No description provided.

a, b = b, a + b


def check_fibonacci(data: Sequence[int]) -> bool:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You dont need to generate a new sequence for check


def find_maximum_and_minimum(file_name: str) -> Tuple[int, int]:
max_value = 1
min_value = 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File can contains only "1", so you cant return "1" as max and min values

def find_maximal_subarray_sum(nums: List[int], k: int) -> int:
summ = 0
overall_sum = 0
current_sum = 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test your function with that data

find_maximal_subarray_sum([1, 4, 7, -10, 6, 1, 1], 3) 

check4 = []
check5 = [0, 1]
check6 = [55, 66]
check7 = [3, 5, 8, 13, 21, 34]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add these params into functions or use pytest's parametrize

Comment on lines 18 to 19
max_value = 0
min_value = 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about negative values?

from typing import List


def find_maximal_subarray_sum(nums: List[int], k: int) -> int:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test with find_maximal_subarray_sum([1, 3, -1, -3, 5, -3, 6, 7], 3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants