See on Github
Com Sci 227
Java
2019, September
8 Hours
The goal of this project was to write several recursive functions. EveryNth should Returns a string containing only the characters of s whose position in s, counting from 1, is zero mod n. IsMatched should Returns true if and only if the String s contains only matched brackets. NoNth should Returns a string containing only the characters of s whose position in s, counting from 1, is non-zero mod n. Pow should Efficiently computes base^exponent (where ^ is the exponentiation operator; that is 2^2 is 2 squared). ToInt should Returns the value of the numeric String number when converted to an integer. Unique should Returns a copy of the input in which all contiguous sequences of identical characters are reduced to a single instance of that character. The most challenging method what isMatched, I would like to revisit this method and try to solve it using a stack.