solved "Squares" and "SubSequenceCount" top coder exercices