leetcode : 344. Reverse String : memory usage beats 99.55 % of javascript submissions
Nice, another leetcode challenge where I beat most of the submissions in memory.

This is most likely because people did not pay attention to the spec which says: “Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.” I took that to mean as you can only have one extra variable so that’s what I used
var reverseString = function(s) {
for(i=0;i<~~(s.length/2);i++){
let temp = s[i]
s[i]=s[s.length-1-i]
s[s.length-1-i] = temp
}
};
Runtime could have been better. My runtime beats 15.26 % of javascript submissions.