← Salesforce questions
CodingReported in a candidate post, Jul 2023

Longest subsequence with product 1 modulo n

Filed under Salesforce

Given an integer n, find the longest subsequence of the sequence [1, 2, ..., n-1] such that the product of the subsequence modulo n equals 1.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Salesforce questions

Collected from public candidate posts and coding forums. Updated Nov 2026.