0 out of 464 challenges solved
Write a function `max_sum_bitonic_subsequence(arr: List[int]) -> int` that takes an array of integers and finds the maximum sum of a bitonic subsequence for the given array. A sequence is bitonic if it is first increasing and then decreasing. #### Example Usage: ```python [main.nopy] max_sum_bitonic_subsequence([1, 15, 51, 45, 33, 100, 12, 18, 9]) # Output: 194 max_sum_bitonic_subsequence([80, 60, 30, 40, 20, 10]) # Output: 210 max_sum_bitonic_subsequence([2, 3, 14, 16, 21, 23, 29, 30]) # Output: 138 ```
from typing import List def max_sum_bitonic_subsequence(arr: List[int]) -> int: """ Calculate the maximum sum of a bitonic subsequence in the given array. Args: arr (List[int]): The input array of integers. Returns: int: The maximum sum of a bitonic subsequence. """ # Placeholder for the solution pass