• + 0 comments

    python

    def encryption(s):
        p=''.join(s.split(' '))
        a=list(map(list,p))
        f=''
        col=math.ceil(math.sqrt(len(a)))
        for d in range(col):
            for j in range(d,len(a),col):
                f+=p[j]
            f+=' '
        return f