Review: Tips For Clean Code

Summarize skills to write clean code with fewer bugs

## Blog link:
for (ik, jk) in [(-1, 0), (1, 0), (0, 1), (0, -1)]:
    i2, j2 = i0+ik, j0+jk
    if i2<0 or i2 >= 2 or j2<0 or j2>=3: continue
    matrix[i0][j0], matrix[i2][j2] = matrix[i2][j2], matrix[i0][j0]
    newState = self.toString(matrix)
    if newState not in visited:

  • Presum
  • Scan and save to avoid 2 pass
  • Avoid unnecessary precheck

See more blog_posts.

<div style=”overflow: hidden;”>

<div style=”float: left; padding: 5px”> <a href=”“><img src=”linkedin.png” alt=”linkedin” /></a></div>

<div style=”float: left; padding: 5px”><a href=”“><img src=”github.png” alt=”github” /></a></div>

<div style=”float: left; padding: 5px”><a href=”” target=”_blank” rel=”nofollow”><img src=”slack.png” alt=”slack”/></a></div>


Share It, If You Like It.

Leave a Reply

Your email address will not be published.