Skip to content

Instantly share code, notes, and snippets.

View zhexuany's full-sized avatar
🎯
Focusing

Zhexuan Yang zhexuany

🎯
Focusing
  • Shanghai
View GitHub Profile
@zhexuany
zhexuany / tags.py
Created December 1, 2017 23:59
It is a simple python script which help you grab all leetcode problem by tags.
import requests
import bs4
root_url = 'http://leetcode.com'
index_url = root_url + '/tag/dynamic-programming/'
def get_problem_number_by_tags():
response = requests.get(index_url)
soup = bs4.BeautifulSoup(response.text, "html5lib")
table = soup.find('table')
table_body = table.find('tbody')
rows = table_body.find_all('tr')

Keybase proof

I hereby claim:

  • I am zhexuany on github.
  • I am zhexuany (https://keybase.io/zhexuany) on keybase.
  • I have a public key ASCSaCblfAsAfu3_NCSZS03UdF_3KkijpJUMTct7gONqQwo

To claim this, I am signing this object:

@zhexuany
zhexuany / cipher.go
Last active March 29, 2017 14:01
The Vigenère Cipher: A modified version.
package main
import "fmt"
func main() {
key := "BADboy"
msg := "This is fun!"
cm, cmr := initMap()
fmt.Println(encode(msg, key, cm, cmr))
fmt.Println(decode(encode(msg, key, cm, cmr), key, cm, cmr))
@zhexuany
zhexuany / foo.go
Last active February 10, 2020 20:20
Go, X does not implement Y (… method has a pointer receiver)
package main
import (
"fmt"
)
type Foo interface {
Bar()
}