# Foobar, Blossoms, and Isomorphism

DevFeed: [Foobar, Blossoms, and Isomorphism](<https://devfeed.tech/articles/foobar-blossoms-and-isomorphism-22352.md>)

Original publisher: [Read original article](<https://yifan.lu/2017/09/13/foobar-blossoms-and-isomorphism/>)

Author: yifanlu

Published: 2017-09-13T07:00:00Z

Content type: tutorial

Language: en

Sources: [Yifan Lu](<https://devfeed.tech/sources/yifan-lu.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [Google](<https://devfeed.tech/topics/google.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [computer-science](<https://devfeed.tech/tags/computer-science.md>), [foobar](<https://devfeed.tech/tags/foobar.md>), [google](<https://devfeed.tech/tags/google.md>), [guards](<https://devfeed.tech/tags/guards.md>), [latex](<https://devfeed.tech/tags/latex.md>), [math](<https://devfeed.tech/tags/math.md>), [number-theory](<https://devfeed.tech/tags/number-theory.md>), [programming](<https://devfeed.tech/tags/programming.md>), [technical](<https://devfeed.tech/tags/technical.md>)

## AI overview

A detailed solution to Google Foobar's "Distract the Guards" problem. The article models when two guards enter an infinite loop and explains how maximum matching can pair the greatest possible number of guards into such loops.

## Source excerpt

A friend recently invited me to participate in Foobar, Google's recruiting tool that lets you solve interesting (and sometimes not-so-interesting) programming problems. This particular problem, titled "Distract the Guards" was very fun to solve but I found no good write-ups about it online! Solutions exist but it is rather hard to understand how the author came upon the solution. I thought I might take a shot and go into detail into how I approached it-as well as give proofs of correctness as needed.