function to find a duplicate element in a limited range list

Solutions on MaxInterview for function to find a duplicate element in a limited range list by the best coders in the world