JSFiddle - React, Tailwind, and code Playground
JavaScript
const str = 'ABCDEFGHIJKLMN'
const result = str.match(/.{1,4}/g)
.map(i => i.split('').reverse())
.reduce((res, col) => {
col.forEach((c, i) => res[i] += c)
return res
}, ['','','',''])
.join('')
console.log(result)