Tag: two-pointers
Interview Questions
- Interleave gains and losses
- As-of join with a staleness cap
- Forward as-of join for markout
- Reconstruct the prevailing spread at each trade
- Bucket trades by quote regime
- As-of join of trades and quotes
- Run-length compress a fill sequence
- Two-sum in a sorted array, in one pass
- Trapping rain water with two pointers
- Fewest boats to carry everyone across
- Closest pair sum in a sorted array
- Container with most water
- Count order pairs summing to a target size
- Compact a sorted price ladder in place
- Find the duplicate number without modifying the array
- Measure the length of a linked list's cycle
- Find the middle of a linked list in one pass
- Detect a happy number with constant memory
- Detect a cycle in a linked list
- Count every palindromic substring
- Is this a palindrome, ignoring punctuation and case?
- Longest palindromic substring
- Longest run of trades within a cost budget
- Longest run of trades with no repeated symbol
- Shortest window covering at least k distinct symbols
- Longest winning streak after erasing k losing days
- Longest window with at most k distinct symbols
- Longest stretch of prices within a band
- Shortest window that reaches a target sum
- Best uptick with a minimum holding gap
- Merge two sorted lists into a duplicate-free union
- Merge two sorted arrays in place
- Intersection of two sorted linked lists
- Merge two price ladders, summing size on equal prices
- Merge two sorted linked lists
- Merge two sorted quote streams
- Is a message code a clean palindrome
- Does a pair of sizes differ by exactly d
- Sort a book of short, flat, and long positions
- Peak number of concurrent live orders
- Rotate a circular price buffer by k
- Longest window with range under a limit
- Shortest run of trades reaching a target cost
- Run-length string compression
- Three positions that net to flat
- Container with the most water
- Shortest window that sorts the whole array
- Trapping rain water
- Two order sizes closest to a target
- Two-sum on a sorted price ladder
- Longest window where no symbol repeats thrice
- Count runs with at most k losing days
- Push zero-quantity fills to the end