Tap here to switch tabs
Problem
Submissions

Problem: Password Strength

Try to solve the Password Strength problem.

Statement

Given a string password, compute its total strength score.

The total strength is the sum of the values contributed by each distinct character in password, according to the following scoring rules:

  • Each distinct lowercase English letter contributes 11 point.

  • Each distinct uppercase English letter contributes 22 points.

  • Each distinct digit contributes 33 points.

  • Each distinct special character from "!@#$" contributes 55 points.

Return an integer representing the total strength of password.

Constraints:

  • 1≤1 \leq password.length ≤105\leq 10^5

  • password consists of lowercase and uppercase English letters, digits, and special characters from "!@#$".

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Password Strength

Try to solve the Password Strength problem.

Statement

Given a string password, compute its total strength score.

The total strength is the sum of the values contributed by each distinct character in password, according to the following scoring rules:

  • Each distinct lowercase English letter contributes 11 point.

  • Each distinct uppercase English letter contributes 22 points.

  • Each distinct digit contributes 33 points.

  • Each distinct special character from "!@#$" contributes 55 points.

Return an integer representing the total strength of password.

Constraints:

  • 1≤1 \leq password.length ≤105\leq 10^5

  • password consists of lowercase and uppercase English letters, digits, and special characters from "!@#$".