I have never seen this sort of solution for this problem. ty
Use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
after 30 minutes into this task, that's seems geniustic
class is just syntactic sugar for a Constructor function. They're equivalent. ( Some things can be done easier with the function syntax even. )
I feel like for 8 kyu and using them as practice for getting more comfortable with the basic interations of loops, dicts, tuples, lists, strings, and integers is great!
I plan use 8 kyu and up excersies in order to learn new languages. After I have gotten farther along with python I plan to start learning Rust next starting at the beginning.
Clever solution, but you should use here StringBuilder object to create final string for better performance.
The join call here is creating a big string, calling toString would be redundant.
Why we don't do a "toString()" at the end ?
TIL that lastIndexOf exists and I've looked at the String API dozens of times haha