Watch tutorials and explanations by expert teachers that walk through solving this problem.
NeetCodeIO
if else statement
Leet Logics
Developer Docs
The CodingBuddies Guild
CodingNinja
Code Harmony
Code with Bogus Engineer
Alpha-Code
Solve more problems to master this pattern