ACM problem solution