Section 3. Chapter 2
single
Components Methods
Swipe to show menu
First, Copy and Paste the whole implemented class Graph to the Editor, and save it somewhere outside for safety.
Task
Swipe to start coding
We can use getComponents() inside hasOneComponent() function, and return True if answer consists of one component. Let's leave getComponents() as it is, and change hasOneComponent() by calling getComponents() inside it, and analyzing the answer.
Everything was clear?
Thanks for your feedback!
Section 3. Chapter 2
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat