Skip to content

Instantly share code, notes, and snippets.

@elit8888
elit8888 / sudoku.py
Created June 2, 2020 15:23
Solve Sudoku (backtrack)
import unittest
from typing import List, Tuple, Set
class Solution:
def solve(self, puzzle: List[List[int]]) -> List[List[int]]:
self.columns = [set() for _ in range(9)]
self.rows = [set() for _ in range(9)]
self.squares = [[set() for _ in range(3)] for _ in range(3)]
self.res = [row[:] for row in puzzle]
@elit8888
elit8888 / vim_misc.md
Created November 1, 2019 09:30
Vim - some useful keystroke

vimdiff

do  # apply diff from other pane
dp  # push diff to other pane
]c  # jump to next change
[c  # jump to previous change

vim

"""Try to make python code py2 py3 compatible.
However, in the near future, python2 support will be ended.
"""
# py2
print 'Hello World!'
# py3
print('Hello World!')
@elit8888
elit8888 / res_adjust.md
Last active February 1, 2024 23:16
Use keyboard shortcut to adjust resolution higher or lower in MacOS

Resolution Adjustment Shortcut Setup

This note illustrates how to adjust resolution using keyboard shorcut using built-in app automator. After setting up, I can use two actions:

  • Switch to Highest resolution
  • Switch to Default resolution

I'm new to apple script, so the rule is very simple.

References: