Maximum Good Subarray Sum at Atlassian

Medium21.4% acceptance

This problem has 62.5% frequency at Atlassian.

Problem Description

You are given an array `nums` of length `n` and a **positive** integer `k`. A subarray of `nums` is called **good** if the **absolute difference** between its first and last element is **exactly** `k`, in other words, the subarray `nums[i..j]` is good if `|nums[i] - nums[j]| == k`. Return _the**ma...

Read full problem and hints

Topics

Also asked at 5 companies


More Atlassian Questions

View all Atlassian questions