Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Thursday Code Puzzler: Playing With Numbers

DZone's Guide to

Thursday Code Puzzler: Playing With Numbers

· Java Zone ·
Free Resource

Java-based (JDBC) data connectivity to SaaS, NoSQL, and Big Data. Download Now.

By now you should be familiar with our Thursday Code Puzzler slot. The idea is simple: solve the coding problem as efficiently as you can, in any language or framework that you think is suitable.

Note: Even though there really is nothing stopping you from finding a solution to this on the internet, try to keep honest, and come up with your own answer.  It's all about the participation!

This weeks question is about deconstructing numbers to find digits that match a certain pattern.

Write a method that would find all positive integers that do not have 0 in their digits, and have a digital sum equal to 5. An example of this would be 14  (1+4 =5). 

Output what each of the numbers are and, as usual, aim for efficiency in your answer

Thanks to everyone who participated in last weeks question, providing some great solutions. 

Connect any Java based application to your SaaS data.  Over 100+ Java-based data source connectors.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}