Join Regular Classroom : Visit ClassroomTech

Security Key – Wipro NLTH

Description

A company is transmitting data to another server. The data is in the form of numbers. To secure the data during transmission, they plan to obtain a security key that will be sent along with the data. The security key is identified as the count of the repeating digits in the data.
Write an algorithm to find the security key for the data. 

Input
The input consists of integer data, representing the data to be transmitted. 

Output
Print an integer representing the security key for the given data. If no data is repeated it should display
-1

Constraints
NA
Example

Input:
578378923
Output: 3
Explanation

The repeated digits in the data are 7, 8, and 3. So, the security key is 3.


Public Test Cases
Input: 578378923
Expected Output: 3

Categories
Recent Posts