Singapore PM praised after sharing Sudoku-solver code

Singapore PM praised after sharing Sudoku-solver code
File photo of PM Lee Hsien Loong checking his Facebook account in 2012.

SINGAPORE - Singapore's Prime Minister Lee Hsien Loong has revealed his computer programming skills after sharing on Facebook a Sudoku puzzle-solver code he wrote.

Lee, 63, a first-class mathematics graduate from the University of Cambridge in Britain, posted a screenshot of the code written in the C++ programming language.

Describing the program as "pretty basic", Lee also posted a link which contained the full printout of the code and invited readers to tell him if there were bugs.

Lee first revealed his talent for coding in a speech at a technology convention last month.

"I used to enjoy this; it is a long time since I've done anything," he said at the event, referring to the Sudoku code written a few years ago.

The Facebook post on the code has been shared nearly 15,000 times and had more than 42,000 likes by Wednesday afternoon, along with many comments praising Lee.

"Wonder which other PM in the world does this?" said one Facebook user, Judith Oliver.

Miles Berry, a computing lecturer in Britain, tweeted that he would like "coding challenges for our leaders before we vote on Thursday", referring to the nation's upcoming election.

But a group called HackerFantastic posted a Twitter message to Lee saying there was a "vulnerability" to his code as it has a "fixed sized buffer on stack" and used "scanf".

Lee took the feedback in his stride, saying he would "add input validation" in a subsequent version.

More about

Purchase this article for republication.

BRANDINSIDER

SPONSORED

Most Read

Your daily good stuff - AsiaOne stories delivered straight to your inbox
By signing up, you agree to our Privacy policy and Terms and Conditions.