Monthly Archives: November 2015


[leetcode] Number of Islands II

Number of Islands II A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand operation which turns the water at position (row, col) into a land. Given a list of positions to operate, count the number of islands after each […]


[leetcode] Group Shifted Strings

Group Shifted Strings Given a string, we can “shift” each of its letter to its successive letter, for example: “abc” -> “bcd”. We can keep “shifting” which forms the sequence: “abc” -> “bcd” -> … -> “xyz” Given a list of strings which contains only lowercase alphabets, group all strings […]