![]() The first line contains two space-separated integers n and k, the number of elements in the array and length of each sublist/subarray. windyoung opened this issue on 1 comment. Note: The input has to be taken outside the SlidingWindow class and then a call is given to the get_sublist function present inside the class to obtain the desired result ValueError: invalid literal for int () with base 10: b'' 407. Int: the maximum value from the sub-list starting from start index till the end index Int nums: array of n positive integers int start: the starting index of the sub-list (included) int end: the end index of the sub-list (included) The get_max function has the following parameter(s): Int list: the maximum values of each sub-list/sliding window To solve the error, you can use the float() method to convert entered decimal input and then use the int() method to convert your number to an integer. Int nums: array of n positive integers int k: the sliding window length ValueError: invalid literal for int() with base 10 occurs when you convert the string or decimal or characters values not formatted as an integer. The get_sublist function has the following parameter(s): Your task is to create a class named SlidingWindow and implement the functions get_sublist and get_max. ![]() Given as input a list of integers nums and an integer k, return the maximum value of each sub-list of length k
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |