Detect cycle in string-connecting graph
Filed under ServiceNow
The question
Given an array of strings where two strings can be connected if the last letter of one matches the first letter of the other, determine if a cycle can be formed by joining them and write the cycle detection code.
No write-up yet. Related questions below have one.
Related ServiceNow questions
Collected from public candidate posts and coding forums. Updated Nov 2026.