var longestContinuousSubstring = function(s) {
let n = s.length, count = 1, ans = 1;
for (let i = 1; i < n; i++) {
let currCharcode = s.charCodeAt(i);
let prevCharcode = s.charCodeAt(i - 1);
if (currCharcode - prevCharcode === 1) count++;
else count = 1;
ans = Math.max(ans, count);
}
return ans;
};
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)