Amazon OA questions Find password strength
12166

Hi
public static long findStrenght(String passowrd)
I got a question to find password Strength for a given passwrod. e.g. if password= "good" . Then iterate over and find the distinct values:-

g = 1,
o = 1,
o = 1,
d = 1,
go = 2,
oo = 1,
od = 2,
goo = 2,
ood = 2,
good = 3

and at the end add all here 16 is the password strength and return.

Expected output = 16.

Comments (10)