SINGAPORE – Sudoku lovers who have long wanted to know how to quickly solve the combinatorial number-placement puzzle have finally found the answer to their quest… from an unlikely source.

Singapore Prime Minister Lee Hsien Loong has shared the source code of the Sudoku solver he wrote in C++ program several years ago.

“I told the Founders Forum two weeks ago that the last computer program I wrote was a Sudoku solver, written in C++ several years ago. Someone asked me for it. Here is the source code, the exe file, and a sample printout,” Lee said on ihs Facebook page.

The program is pretty basic, the Prime Minister added.

“It runs at the command prompt, in a DOS window. Type in the data line by line (e.g. 1-3-8—6), then the solver will print out the solution (or all the solutions if there are several), the number of steps the program took searching for the solution, plus some search statistics,” he said.

Sudoko Solver code written by Singapore Prime Minister Lee Hsien Loong
Sudoko Solver code written by Singapore Prime Minister Lee Hsien Loong

The Facebook post immediately garnered about 40,000 likes and 13,000 shares. – BusinessNewsAsia.com

Share.