Skip to content

Instantly share code, notes, and snippets.

View ZhongxuanWang's full-sized avatar
🎯
Focusing

Zhongxuan Wang ZhongxuanWang

🎯
Focusing
View GitHub Profile
@ZhongxuanWang
ZhongxuanWang / wordArtp1.py
Created September 19, 2022 23:38
Word Art part 1
# Put your text here
words = 'word-art'
n_special_characters = 0
for w in words:
n_special_characters += w.isalpha()
n_special_characters = len(words) - n_special_characters
words = words.upper()
@ZhongxuanWang
ZhongxuanWang / final.py
Created September 19, 2022 23:02
Word Artist
import cv2
import numpy as np
import matplotlib.pyplot as plt
# Put your text here
words = 'word-art'
n_special_characters = 0
for w in words:
n_special_characters += w.isalpha()
@ZhongxuanWang
ZhongxuanWang / Lala Land and Apple Trees.cpp
Created December 31, 2020 18:45
Codeforces Problem - Lala Land and Apple Trees (https://codeforces.com/contest/558/problem/A)
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<pair<int, int> > ps;
@ZhongxuanWang
ZhongxuanWang / get_time_diff.py
Created May 1, 2020 11:21
python get the time between string dates
def get_time(**time):
time_now = datetime.now()
datetime_format = '%Y-%m-%d %H:%M'
time_now = datetime.strptime(time_now, datetime_format)
time_des = f"{time['year'] + time_now}-{time['month']}-{time['day']} {time['hour']}:{time['minute']}"
diff = time_now - datetime.strptime(time_des, datetime_format)
print("Difference:", diff)