Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

Python 2, (削除) 199 (削除ここまで) 196 bytes#bytes

-3 bytes thanks to Kevin Cruijssen

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):return i

Try it online!

Python 2, (削除) 199 (削除ここまで) 196 bytes#

-3 bytes thanks to Kevin Cruijssen

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):return i

Try it online!

Python 2, (削除) 199 (削除ここまで) 196 bytes

-3 bytes thanks to Kevin Cruijssen

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):return i

Try it online!

deleted 73 characters in body
Source Link
Hori
  • 321
  • 1
  • 3

Python 2, (削除) 199 (削除ここまで) 196 bytes#

-3 bytes thanks to Kevin Cruijssen

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):return i

Still looking for a better solution; indentations take a lot of bytes

Try it online!

Python 2, (削除) 199 (削除ここまで) 196 bytes#

-3 bytes thanks to Kevin Cruijssen

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):return i

Still looking for a better solution; indentations take a lot of bytes

Try it online!

Python 2, (削除) 199 (削除ここまで) 196 bytes#

-3 bytes thanks to Kevin Cruijssen

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):return i

Try it online!

added 49 characters in body
Source Link
Hori
  • 321
  • 1
  • 3

Python 2, 199(削除) 199 (削除ここまで) 196 bytes#

-3 bytes thanks to Kevin Cruijssen

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):return(i)

Still looking for a better solution; indentations take a lot of bytes

Try it online! Try it online!

Python 2, 199 bytes#

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):return(i)

Still looking for a better solution; indentations take a lot of bytes

Try it online!

Python 2, (削除) 199 (削除ここまで) 196 bytes#

-3 bytes thanks to Kevin Cruijssen

from md5 import*
B=bytearray
h=lambda a,b:sum(bin(i^j).count('1')for i,j in zip(B(a),B(b)))
m=lambda a:new(a).hexdigest()
def f(x):
 a=b=m(x);i=1
 while 1:
 b=m(b);i+=1
 if h(x,a)==h(x,b):returni

Still looking for a better solution; indentations take a lot of bytes

Try it online!

Source Link
Hori
  • 321
  • 1
  • 3
Loading

AltStyle によって変換されたページ (->オリジナル) /