Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

PM Lee shares code that solves Sudoku on Facebook

Zafirah Salim | May 6, 2015
The last programme he wrote was a Sudoku solver in C++ programming language several years ago.

Delivering a speech at the Founders Forum Smart Nation Singapore reception on April 20, 2015, Prime Minister Lee Hsien Loong shared that he has a personal interest in coding, adding that he has been dabbling with C++ programming language in his spare time.

Speaking to IT industry leaders at the event, PM Lee said that the last programme he wrote was a Sudoku solver in C++ several years ago.

This comment sparked a number of requests to see the code for his programme. Earlier this week, on May 4, 2015, PM Lee uploaded a screenshot of the code, along with a link to a Google Drive folder that contains the source code, the exe file and a sample printout.

He wrote, "The program is pretty basic. Type in the data line by line then the solver will print out the solution, the number of steps the program took searching for the solution, plus some search statistics ... Hope you have fun playing with this. Please tell me if you find any bugs!"

The post has since garnered thousands of comments, mostly of people expressing their admiration for PM Lee's surprising knowledge of code programming.

PM Lee is a graduate from Cambridge University with a first-class degree in mathematics and a diploma in computer science.


Sign up for CIO Asia eNewsletters.