Week 11
Today I did another leetcode problem. Like last week I found a similar problem to one I've done in class but with a different language but instead of mips this time it is in C++. I'm starting to think my 240 teacher was making us do these problems on purpose haha... anyway, the problem this time is called valid parenthesis or matching brackets is what my 240 teacher called it. I knew the basic rundown of the problem and tried to code it. But to give a brief rundown we are checking if all brackets "(" or "{" or "[" are closed correctly. Fortunately, I was able to directly translate the code for the most part, so we can see the tiny differences between c++ and java. We see in the two pictures below that c++ looks a little different. In java we see the stack as new stack but in C++ #include stack and we dont need to new. In C++ the string as treated a char arrays so we dont need to do charAt in C++ they already are characters and in this respect i...