Online Judge Algorithm practices