Update 5_Silver_2P.md

This commit is contained in:
Darren Yao 2020-06-08 01:49:17 -07:00 committed by GitHub
parent c99c5cac0c
commit c643c39aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,25 @@
---
slug: /silver/two-pointers
title: "Two Pointers"
author: Unknown
author: Darren Yao
order: 5
prerequisites:
-
- Silver - Sorting
---
- CPH 8.1
# Two Pointers
Iterating two monotonic pointers across an array to search for a pair of indices satisfying some condition in O(n).
See 14.1 of https://www.overleaf.com/project/5e73f65cde1d010001224d8a
# Tutorials
- Intro to USACO, 14.1: [Java](http://darrenyao.com/usacobook/java.pdf) [C++](http://darrenyao.com/usacobook/cpp.pdf)
- CPH 8.1
<!-- END DESCRIPTION -->
# Problems
- [CSES Sum of Two Values](https://cses.fi/problemset/task/1640)
- [CSES Maximum Subarray Sum](https://cses.fi/problemset/task/1643)
# Extensions
The two pointers technique can be extended to the two dimensional sliding window algorithm. If you're looking for a more challenging problem using 2-D sliding window, see [USACO Fort Moo](http://usaco.org/index.php?page=viewproblem2&cpid=600)
<!-- END DESCRIPTION -->