switch generator for simpler table in scala reverseStrings; implement permutations example in python, scala, java