2 Bingo Numbers Game

Company: Thoughtworks_17oct

Difficulty: medium

Problem Statement

2 Bingo Numbers Game Problem Description "There will be a number game today after work — everyone who's available is welcome to join, bring your laptop please!" You saw that message posted in your group chat. "What's that?" you ask your teammate, confused; you only joined ThoughtWorks this week. "Oh, you know, there are always activities after work — relax, have fun, get to know more people. Feel free to join," they answer. "OK, maybe it's not too bad, let's see," you think. Five hours later you walk into the room and some people are already seated. The facilitator starts: "Welcome everyone. Today we have a new game, and it's about numbers. We will give you a list of numbers, and for each one you must find its two Bingo Numbers ." Each number is given as a string of digits. For one such number, look at the set of distinct digits that occur in it. From that set pick two different digits d1 and d2 so that: their sum d1 + d2 is as large as possible , subject to d1 + d2 <= 15 ; and if s