Search⌘ K
AI Features

Total Appeal of a String

Total Appeal of a String asks you to consider every contiguous substring, count its distinct characters, and return the sum of those counts across the entire string.

Statement

Given a string s, return its total appeal, which is calculated by summing the ...