Falsification

This post is meant to cover a helpful mental model that I can use for improving my decision-making. Normally, when you're presented with possible solutions to a problem, the default pattern of thought is to find more samples that fit along with the ideas. This is exactly the opposite of…

Application State Graph Traversal

When you're trying to perform automation on an application, if there's only certain end-points that you're checking (with many intermediate states that you need to visit), it may be helpful to represent the application as a state graph. That way, you can shorten the amount of code that's required for…

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…