careercup / CtCI-6th-Edition

Cracking the Coding Interview 6th Ed. Solutions
11.33k stars 4.41k forks source link

Combine insert and delete symbol condition #237

Closed Tsvetoslav88 closed 2 years ago

Tsvetoslav88 commented 2 years ago

Here I provided a small suggestion for improvement that will reduce the boilerplate code. As we have for both conditions the same method execution, I would suggest using the "||" statement