Dynamic Programming Solution for Facebook Hacker Cup Problem AAAAAA in B-Prolog | Hacker News Reader