|
-
Mar 1st, 2002, 10:09 AM
#1
Thread Starter
Lively Member
Smarty Pants?
Every now and then the guys and I at work have a challenge. Our boss will give us 20 or so strings and every string has a unique result. What we have to do is figure out how you get that result. First one to get it correctly gets a free lunch, all the other people have to pay for the winners lunch.... its kinda fun, and usually im pretty good at this stuff, but this time im having a little trouble. Anyone care to give this a shot? im starving with no money 
string: aaaaaaaaaaaaaaaaaaa
result: 0
string: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
result: 0
string: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
result: 0
string: ab
result: 1
string: abcdefg
result: 3
string: 1234567
result: 3
string: 7654321
result: 3
string: !@#$%^&
result: 1
string: abcdefghijklmnopqrstuvwxyz
result: 13
string: abcdefghijklmnopqrstuvwxyz1234567890
result: 0
string: RtRtRtRtRt
result: 5
string: aaaaaaaaaaaaaaaaaaaaab
result: 1
string: 4983740742
result: 10
string: YkjGlD08Dg7435jJDf787jlasffFDK9&fjg
result: 120
string: asdfds()&(SD&Fdskj44984sd98f498345345s84498s4s98x4e98579
result: 982
string: HelloThereHowAreYou?
result: 33
-
Mar 1st, 2002, 10:24 AM
#2
Just a guess, as I havent tested it. Take each letter of the string. The first letter, subtract from 0, the second add to the result, the third subtract, the fourth add, etc. For the first 2, it seems like you would end up with 0, the thrid, 0-a+b == 1, etc.
Z.
-
Mar 1st, 2002, 01:29 PM
#3
Thread Starter
Lively Member
i allready tried that, doesnt work.. looks like it should, untill you get to the alphabet stuff
-
Mar 2nd, 2002, 04:58 AM
#4
no, it already fails for the first one because there are 19 as
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|