<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Greedy on Rik Kisnah - Blog</title><link>https://www.rik-kisnah.ai/tags/greedy/</link><description>Recent content in Greedy on Rik Kisnah - Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 07 May 2019 09:00:00 -0700</lastBuildDate><atom:link href="https://www.rik-kisnah.ai/tags/greedy/feed.xml" rel="self" type="application/rss+xml"/><item><title>Merge Intervals</title><link>https://www.rik-kisnah.ai/teach/coding/merge-intervals/</link><pubDate>Tue, 07 May 2019 09:00:00 -0700</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/merge-intervals/</guid><description>Sort your meetings by start time, then walk the calendar once. If the next one starts before the current one ends, stretch. This one shape covers half of all scheduling questions.</description></item><item><title>Intervals</title><link>https://www.rik-kisnah.ai/teach/coding/intervals/</link><pubDate>Tue, 27 Mar 2018 09:00:00 -0700</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/intervals/</guid><description>Start and end pairs: meetings, bookings, ranges. Sort them and the mess becomes a line you walk once. Sort by start to merge. Sort by end to pick the most that fit. The only question at each step is whether the next one starts before the current one ends.</description></item><item><title>Best Time to Buy and Sell Stock</title><link>https://www.rik-kisnah.ai/teach/coding/best-time-to-buy-and-sell-stock/</link><pubDate>Tue, 14 Mar 2017 09:00:00 -0800</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/best-time-to-buy-and-sell-stock/</guid><description>Prices for each day. Buy once, sell once later, make the most money. Walk the days once, remembering only the cheapest price so far. The lesson is what to carry and what to throw away.</description></item><item><title>Container With Most Water</title><link>https://www.rik-kisnah.ai/teach/coding/container-with-most-water/</link><pubDate>Tue, 08 Nov 2016 09:00:00 -0800</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/container-with-most-water/</guid><description>Vertical walls of different heights. Pick two that hold the most water between them. Start with a finger at each end and always move the shorter wall inward. Same shape as sorted Two Sum, and the lesson is why the move is safe.</description></item></channel></rss>