This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programming Diversions and the fly likes ZerosOnesTwos... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "ZerosOnesTwos..." Watch "ZerosOnesTwos..." New topic
Author

ZerosOnesTwos...

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
This was asked during one test by one company recently.
"-0s -1s -2s -3s -4s -5s -6s -7s -8s -9s"
Replace - with numbers(from 0 to 9. Any digit can appear more than once) so that above expression makes sense.
For example: 10s 21s makes sense as there are one zeros and two ones. where as 10s 21s 32s is wrong bcos last part says there are three 2s where as there are only two 2s in expression.
[ December 01, 2003: Message edited by: Capablanca Kepler ]
[ December 02, 2003: Message edited by: Capablanca Kepler ]

MH
Shalu Ban
Ranch Hand

Joined: Feb 18, 2003
Posts: 72
Hi,
Is it :
10s 81s 22s 13s 14s 15s 16s 17s 28s 19s
:roll:
[ December 02, 2003: Message edited by: Shal Ban ]

Happiness is doing what is right.
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Originally posted by Shal Ban:
Hi,
Is it :
10s 81s 22s 13s 14s 15s 16s 17s 28s 19s
:roll:
[ December 02, 2003: Message edited by: Shal Ban ]

Hmm,no,You say there are 22s but there are actually three 2s,third one preceding 8s.
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
on the right side of everything, every number appears.
Therefore, no number will be 0xs. That means that the 0
appears only once. The answer must start with 10s.
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
10s 71s 32s 23s 14s 15s 16s 27s 18s 19s
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Correct .Thats the answer I also got.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ZerosOnesTwos...