<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Arrays on Rik Kisnah - Blog</title><link>https://www.rik-kisnah.ai/tags/arrays/</link><description>Recent content in Arrays on Rik Kisnah - Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 03 Oct 2017 09:00:00 -0700</lastBuildDate><atom:link href="https://www.rik-kisnah.ai/tags/arrays/feed.xml" rel="self" type="application/rss+xml"/><item><title>Sliding Window, Fixed Length</title><link>https://www.rik-kisnah.ai/teach/coding/sliding-window-fixed-length/</link><pubDate>Tue, 03 Oct 2017 09:00:00 -0700</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/sliding-window-fixed-length/</guid><description>Find the best run of exactly k items in a row. Do not re-add the window every time it moves. Add the one coming in, subtract the one going out. One pass, and the same trick works for sums, counts and letters.</description></item><item><title>Binary Search</title><link>https://www.rik-kisnah.ai/teach/coding/binary-search/</link><pubDate>Tue, 22 Aug 2017 09:00:00 -0700</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/binary-search/</guid><description>Guess my number between 1 and 100. Always guess the middle. Seven guesses, every time. The off-by-one errors are where the interview happens.</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><item><title>Move Zeroes</title><link>https://www.rik-kisnah.ai/teach/coding/move-zeroes/</link><pubDate>Tue, 19 Jul 2016 09:00:00 -0700</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/move-zeroes/</guid><description>Push every zero to the end of the array without changing the order of everything else. One finger marks where the next non-zero belongs. That finger is the whole idea behind two pointers.</description></item><item><title>Two Sum</title><link>https://www.rik-kisnah.ai/teach/coding/two-sum/</link><pubDate>Tue, 14 Jun 2016 09:00:00 -0700</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/two-sum/</guid><description>Find two numbers in a list that add up to a target. Unsorted list: remember what you have seen in a hash map. Sorted list: one finger at each end, walk them towards each other. Two tricks, one problem, and half of the array questions you will ever be asked.</description></item></channel></rss>