Skip to content

Instantly share code, notes, and snippets.

View adrianshum's full-sized avatar
💭
@.@

Adrian Shum adrianshum

💭
@.@
View GitHub Profile
max_days = {}
for d in list2: # or list1, works the same
day, month = int(d[:2]), d[2:]
if month not in max_days or day > max_days[month]:
max_days[month] = day
result = [f"{value:02}{key}" for key,value in max_days.items()]
print(f">>> {result}")
@adrianshum
adrianshum / Foo.java
Created September 20, 2016 09:50
Multi-Bound Type Param Example
import java.util.*;
import java.io.*;
public class Foo {
public static void main(String[] args) throws Exception{
RandomAccessFile input1 = new RandomAccessFile("c:\\temp\\Foo.java", "rw");
System.out.println("1" + read(input1));
DataInputStream input2 = new DataInputStream(new FileInputStream("c:\\temp\\Foo.java"));
System.out.println("2" + read(input2));
}