JavaScript solution (not faster .just an idea)
javascript\nvar reverseStr = function(s, k) {\n    if(s.length <= k ) return s.split("").reverse().join("");\n    var res = [];\n    s = s.split("");\n    while
```javascript\nvar reverseStr = function(s, k) {\n    if(s.length <= k ) return s.split("").reverse().join("");\n    var res = [];\n    s = s.split("");\n    while(s.length>k){\n        res.push(...(s.splice(0,k).reverse()));\n        res = res.concat(s.splice(0,k));\n    }\n    res.push(...(s.reverse()));\n    return res.join("");\n};\n```
[]