From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Rutherford Appleton Laboratory

cancel
Showing results for 
Search instead for 
Did you mean: 

User Group Challenge - June 2015 - Number Rotation

Challenge:

Create a VI that will determine the largest integer that can result from performing a series of any number of digit rotations on an inputted integer.

The VI must perform at least 1 digit rotation. Digit rotations can be in either direction (moving the first digit to the end of the number or moving the last digit to the front of the number), but the series must always go in the same direction. If there are any leading zeros after digit rotation they must be removed. The Inputted integer will always be positive.

0 Kudos
Message 1 of 3
(6,842 Views)

Here's my attempt.

I mis-interpreted the 'Digit rotations can be in either direction' bit, I thought this meant you could chose so it only goes one way.

Also leading zeroes are removed (or, not displayed anyway) but this doen't carry on to the next rotation - as it wasn't explicitly asked for 😛

For fun I added a spinning graphic that is supposed to slow down then stop and give the answer.

0 Kudos
Message 2 of 3
(5,654 Views)
0 Kudos
Message 3 of 3
(5,654 Views)