Cmenay’s Weblog
Just another WordPress.com weblog

LC-Display

Read it here.

Another fun problem, at least for me. Is not hard, i solved it in a less than an hour, but I had tons of Presentation Error! (that means, my algorithm was right, but i had some ‘\n’ or ‘  ‘ extra or missed), until finally i realized my mistake ( a ‘\n’ missed before EOF).

For this problem i wanted a short algorithm, i didn’t want to write a lot of repetitive code, so i studied for a while how the numbers “grow”, making some draws in a piece of paper, then the algorithm is almost obvious. You need to be really careful while writting the code, because all you need is a pair of loops, but some problems may appear if you don’t check that the limits, increments, array’s indexes and sizes, are right.

Then if you accomplish that, compare your output with the sample one, and check that you are exactly following the problems instructions. After that you are done.

Easy and fun problem, that looks quite cool.

LCD problem screenshot

Advertisement

No Responses to “LC-Display”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.