Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    \$\begingroup\$ I count 145 bytes. You can golf it by removing unneeded whitespace, such as between import *, a(x, y), x[ptr]=z+y, etc. You can also replace the 4 spaces with a single space \$\endgroup\$ Commented Apr 29, 2016 at 23:58
  • \$\begingroup\$ You can put x[ptr]=z+y on the same line as if random()>0.5 to save 3 bytes of whitespace. In python 2 0.5 can be written as .5 to save a byte, I don't know if that's true in python 3 though. If you rename ptr to p you'll save 6 bytes in all. Also, are you on Windows? Windows stores newlines as two bytes, but since python doesn't care if the newline is one byte or two you can count it as 1, making your current solution only 103 bytes. By the way, welcome to PPCG :) \$\endgroup\$ Commented Apr 30, 2016 at 17:40