6
Ivan Spodeneyko
Last seen 2 years ago
Member for 8 years, 1 month, 17 days
Difficulty Normal
Yust exactly how my solution, except I used:
return sorted(w1) == sorted(w2)
It is same logic.
More
I really like your solution!
But the code below always gives 0 . Isn't it?
length = 30 * min(len(word1) / len(word2), len(word2) / len(word1))
In my code i did:
length = 30 * min(float(len(word1)) / float(len(word2)),
float(len(word2)) / float(len(word1)))
More
You can do this a little shorter. Instead of:
elif x == 'POP':
if len(stack) != 0:
checksum += stack[-1]
stack.pop()
You can write:
elif x == 'POP'and len(stack) != 0:
checksum += stack.pop()
BTW I lerned usefull stuff from your code!
More
I did not get what that code does:
def delete(word):
temp=""
for j in "abcdefghijklmnopqrstuvwxyz":
if j in word:
temp+=j
return temp
You already delete all punctuation with :
word = message.replace(",","").replace(".","").replace(";","").replace("'","").
More
Also in my case that code gave me O:
len(word[j])/len(word[i])*30
Because Python is round int to the floor. For instance, 4/6 will be 0.
I did:
float(len(word[j]))/float(len(word[i]))*30
Any way intresting solution
More
thats not right solution!
In 2nd exemple it will count grid[-1][-1],grid[-1][0],grid[0][-1] and grid[1][-1].
But not supose to.
More
It seems not quite fit for 'clear' category. I can't get my head around the solution.
More