arya2004 / leetcode-daily-october-hacktoberfest-2024

Leetcode Daily October Hacktoberfest 2024
MIT License
10 stars 49 forks source link

feat(add): solution python #41

Closed rrayhka closed 1 month ago

rrayhka commented 1 month ago

Description

This pull request implements the solution for the problem "Check Arithmetic Subarrays" from LeetCode. The task is to verify if each subarray in the provided ranges can be rearranged to form an arithmetic sequence.

Fixes #1

Type of Change

How Has This Been Tested?

This solution has been tested using various test cases provided by LeetCode, as well as additional custom cases to ensure the logic is sound.

Test Configuration:

Checklist:

Additional Information

This solution is efficient, sorting each subarray and then checking the arithmetic condition in O(k log k) time for each query, where k is the length of the subarray. This approach ensures that the time complexity is manageable within the problem's constraints.