Tag: string algorithm
A valid parentheses string is either empty (“”), “(” + A + “)”, or A + B, where A and B are valid parentheses strings, and + represents string …
The string repeat function namely, String.prototype.repeat() is available since ECMAScript 6. The String Repeat function is a handy string method that allows you to repeat a source string a …
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number is strobogrammatic. The …
Two strings are isomorphic if the characters in one string can be replaced to get another one. No two characters may map to the same character. A character can …
Given a string that contains characters of ASCII no more than 256, sort it in non-ascending order based on the frequency of the characters. For example, Input “tree” the …