+ H S A I T W D I O A A A O H T I H W I E I O A O S
In the above expression, each letter stands for a single unique digit. Calculate A E I O H W D S T .
Details and Assumptions
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Raghav for the win.
Log in to reply
I knew this one. This problem was just for introducing some Python 3.x
Log in to reply
Actually I don't know it.. I have just been copy pasting it from @Aditya Raut 's solution to solve everything.
Log in to reply
@Raghav Vaidyanathan
–
It just uses the different permutations of a string '0123456789'. Then
join
method is used to convert the permutation object to string. Now, randomly, all the letters are given a position. At the end, the condition is checked by converting string to int. Its easier to concatenate strings, thus conversion is followed by concatenation.
A far more easier solution will be this .
Don't get angry at me Pranjal , it's just that I have bookmarked a lot of sites and now they are coming in handy !
Here is my C code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
Python is good but i like C.
Usually C/C++ are not of use while dealing with bigger numbers (due to lack of such data types). Thus, I have moved on to python recently.
Python 2.7:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
I'm pretty ashamed of needing to use 30 lines and 70 seconds of running time, but give me a break, I hit my head today on the road during a bicycle wreck and had a concussion. :P
Are you all right now ?
Log in to reply
Yeah, I feel a million times better. Thanks for asking.
Problem Loading...
Note Loading...
Set Loading...
This is a general solution for which I posted this problem. For more details, see this