<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Two Pointer on 111qqz's blog</title><link>https://111qqz.com/en/tags/two-pointer/</link><description>Recent content in Two Pointer on 111qqz's blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2015-2026 111qqz</copyright><lastBuildDate>Thu, 13 Apr 2017 12:02:02 +0000</lastBuildDate><atom:link href="https://111qqz.com/en/tags/two-pointer/index.xml" rel="self" type="application/rss+xml"/><item><title>leetcode 75. Sort Colors</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-75-sort-colors/</link><pubDate>Thu, 13 Apr 2017 12:02:02 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-75-sort-colors/</guid><description>&lt;p&gt;Given an array with &lt;em&gt;n&lt;/em&gt; objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.&lt;/p&gt;</description></item><item><title>leetcode 11. Container With Most Water (two pointer)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-11-container-with-most-water-two-pointer/</link><pubDate>Thu, 13 Apr 2017 10:13:01 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-11-container-with-most-water-two-pointer/</guid><description>&lt;p&gt;Given &lt;em&gt;n&lt;/em&gt; non-negative integers &lt;em&gt;a1&lt;/em&gt;, &lt;em&gt;a2&lt;/em&gt;, &amp;hellip;, &lt;em&gt;an&lt;/em&gt;, where each represents a point at coordinate (&lt;em&gt;i&lt;/em&gt;, &lt;em&gt;ai&lt;/em&gt;). &lt;em&gt;n&lt;/em&gt; vertical lines are drawn such that the two endpoints of line &lt;em&gt;i&lt;/em&gt; is at (&lt;em&gt;i&lt;/em&gt;, &lt;em&gt;ai&lt;/em&gt;) and (&lt;em&gt;i&lt;/em&gt;, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.&lt;/p&gt;</description></item><item><title>leetcode 16. 3Sum Closest (k-sum问题，two pointer)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-16-3sum-closest/</link><pubDate>Thu, 13 Apr 2017 09:45:45 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-16-3sum-closest/</guid><description>&lt;p&gt;Given an array &lt;em&gt;S&lt;/em&gt; of &lt;em&gt;n&lt;/em&gt; integers, find three integers in &lt;em&gt;S&lt;/em&gt; such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution.&lt;/p&gt;</description></item><item><title>leetcode 18. 4Sum (k-sum问题，two pointer)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-18-4sum/</link><pubDate>Thu, 13 Apr 2017 09:34:15 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-18-4sum/</guid><description>&lt;p&gt;Given an array &lt;em&gt;S&lt;/em&gt; of &lt;em&gt;n&lt;/em&gt; integers, are there elements &lt;em&gt;a&lt;/em&gt;, &lt;em&gt;b&lt;/em&gt;, &lt;em&gt;c&lt;/em&gt;, and &lt;em&gt;d&lt;/em&gt; in &lt;em&gt;S&lt;/em&gt; such that &lt;em&gt;a&lt;/em&gt; + &lt;em&gt;b&lt;/em&gt; + &lt;em&gt;c&lt;/em&gt; + &lt;em&gt;d&lt;/em&gt; = target? Find all unique quadruplets in the array which gives the sum of target.&lt;/p&gt;</description></item><item><title>leetcode 15. 3Sum (k-sum问题，two pointer)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-15-3sum/</link><pubDate>Thu, 13 Apr 2017 08:21:52 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-04-13-leetcode-15-3sum/</guid><description>&lt;p&gt;Given an array &lt;em&gt;S&lt;/em&gt; of &lt;em&gt;n&lt;/em&gt; integers, are there elements &lt;em&gt;a&lt;/em&gt;, &lt;em&gt;b&lt;/em&gt;, &lt;em&gt;c&lt;/em&gt; in &lt;em&gt;S&lt;/em&gt; such that &lt;em&gt;a&lt;/em&gt; + &lt;em&gt;b&lt;/em&gt; + &lt;em&gt;c&lt;/em&gt; = 0? Find all unique triplets in the array which gives the sum of zero.&lt;/p&gt;</description></item></channel></rss>