#3115

Maximum Prime Difference

medium · 58.6% accepted · 125 likes · top 55%

array · math · number theory

Description

You are given an integer array nums.

Return an integer that is the maximum distance between the indices of two (not necessarily different) prime numbers in nums.

Solution