maximum_size_subarray_sum_equals_k

package
v1.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2019 License: MIT Imports: 0 Imported by: 0

README

< Previous                  Next >

325. Maximum Size Subarray Sum Equals k (Medium)

[Hash Table]

Similar Questions

  1. Minimum Size Subarray Sum (Medium)
  2. Range Sum Query - Immutable (Easy)
  3. Contiguous Array (Medium)
  4. Subarray Product Less Than K (Medium)

Hints

Hint 1 Try to compute a sum of a subsequence very fast, i.e in O(1) … Think of prefix sum array.
Hint 2 Given S[i] a partial sum that starts at position 0 and ends at i, what can S[i - k] tell you ?
Hint 3 Use HashMap + prefix sum array.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL