Lucid Software interview question

OA: 952. Largest Component Size by Common Factor