HackerRank

My first reaction was, total No. of strings - no. of palindromic strings. But looks like counting all palindromic strings is not that easy.. So it has to be tackled from the other side: composing Anti-Palindrome directly. And then I found this link: https://github.com/algorhythms/HackerRankAlgorithms/blob/master/AntiPalindromic%20Strings.py

Totally borrowed his code. So will not paste it here.

原文地址:https://www.cnblogs.com/tonix/p/4469047.html