Get unlimited access
Open in app
Home
Notifications
Lists
Stories

Write

Mono Sequence

3

Stories

1

Writers

Start writing
  • Trending

  • Latest

  • Best

Eddie Dong

Eddie Dong

·Jan 14, 2021

LC 31

Goal: Given an array of non-negative integers, find the lexicographically next permutation. If no such permutation, return the ascending order permutation. Intuition: 1. Notice that non-increasing sequence does not have next greater permutation, and non-decreasing sequence is the smallest permutation. 2. …

Mono Sequence

1 min read

LC 31
LC 31

Eddie Dong

Eddie Dong

·Jan 13, 2021

LC 239

Goal: Given an integer array and window side of K, find the max values for every window in the array. Return the max values array. Intuition: For window of size k ending with [i], the max of this window must ≥ [i] and must be within the window borders. …

Mono Sequence

2 min read

LC 239
LC 239

Eddie Dong

Eddie Dong

·Jan 13, 2021

LC 862

Goal: find the size of shortest subarray in given array that sum up to at least K, where negative integer is allowed. Reasoning for techniques used: 1. Prefix sum: Because negative number is allowed. This causes a problem that you don’t know when to stop expanding or shrinking the window. It’s…

Mono Sequence

1 min read

LC 862
LC 862

Related Topics

Sliding Windows
Math
Prefix Sum
Sorting

3

Stories

1

Writers

Related Topics

Sliding Windows
Math
Prefix Sum
Sorting

Visit the archive

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Knowable