Shortest Path with Alternating Colors Pretty much usual BFS problem with another dimension, colors. We need to store a Pair of NodeId and Color in the queue instead of only nodes.
As Far from Land as Possible This is a classic BFS problem. Put all the land cells in the queue and run Breadth First Search to find farthest water cell or vice versa.
Permutation in String To verify if a substring in S2 is a permutation of S1, counting the frequency of characters in that substring and comparing them with characters frequency of S1 should do it.