Anuj
BAN USER
Questions (1)
Comments (4)
Reputation -20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
-2
of 2 vote
You know, you can do this in 19 minutes...
First let 2 and 1 cross the bridge. Time taken 2 mins.
Then have 1 come back. Time taken 1 mins. Total time 3 mins.
When 1 comes back, Have 10 and 5 cross the bridge. Time taken 10 mins. Total 15 mins
Now when 10 and 5 get on the other side. Let 2 come back. Total time taken 17 mins.
Now 2 and 1 can cross again. Time taken 2 mins. Total time 19 mins.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Iterate through the array, take each string and hash it based on it's characters. A simple scheme could be to simply sort all characters in alphabetical order. Put it in a hash table.
- Anuj January 27, 2007Iterate through the hashtable and print out the strings.