Problem: Closest Pair

Problem Given an input string vector, find the distance between the closest pair of equal value entries. Constraints Can we assume that we'll have more than a few additional words of memory? Yes. If there is a tie for minimum distance between the closest pair of entries, how do we…

Python Partials

When I was looking through some Kivy code, I came through an example where Python partials were used. Although I've read about partials in the docs, I've never used them in my code. The official docs say: Return a new partial object which when called will behave like func called…

Problem: Array Single Value Appears Twice

Problem You are given a read only array of n integers from 1 to n. Each integer appears exactly once except A which appears twice and B which is missing. Return A and B. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra…

Grammar Lessons

My writing is atrocious: that's something that becomes apparent after making even slight passes through this blog. Recently, I decided to improve my writing by completing daily grammar exercises. The exercises take roughly 20-30 minutes a day and involve some very basic examples (e.g. comma and colon use). I…

Fedora20 HowTO - Android Studio

Setting up Android Studio on Fedora20 is a pretty fast process. First, make sure JDK and JRE are installed. Here's a good guide. Now we're going to install Android Studio. Download the archive from the Android Studio official homepage. Change to root user su - Extract Android-Studio package (example to…