Solved CountSeq. May want to improve it later.
Solved mostDistant. Should try to improve later.