adding leetcode problem solution

This commit is contained in:
Jidong Xiao
2024-01-16 13:39:24 -05:00
parent 94a69a8524
commit b5cb9cbdd8
3 changed files with 28 additions and 3 deletions

View File

@@ -130,4 +130,4 @@ cost of copying.
- [Leetcode problem 8: String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/)
- [Leetcode problem 211: Design Add and Search Words Data Structure](https://leetcode.com/problems/design-add-and-search-words-data-structure/)
- [Leetcode problem 1662: Check If Two String Arrays are Equivalent](https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/)
- [Leetcode problem 1662: Check If Two String Arrays are Equivalent](https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/) Solution: [p1662_check_two_strings.cpp](../../leetcode/p1662_check_two_strings.cpp)

View File

@@ -27,14 +27,14 @@
## 3.3 Class scope notation
In the *Date* class example as you saw in lab 2,
In the *Date* class example as you see in lab 2,
- **Date::** indicates that what follows is within the scope of the class.
- Within class scope, the member functions and member variables are accessible without the name of the object.
## 3.4 Constructors
These are special functions that initialize the values of the member variables. The constructor automatically get called when an object of the class is created. You have already used constructors for string and vector objects. As you have seen in the lab, constructors in C++ have the following characteristics:
These are special functions that initialize the values of the member variables. The constructor automatically get called when an object of the class is created. You have already used constructors for string and vector objects. As you see in the lab, constructors in C++ have the following characteristics:
- Constructors have the same name as the class they belong to.
- They do not have a return type, not even void.