Algorithm · Salesforce · Medium
You are given a string s that consists of lowercase English letters. You may pick any character (including one that does not appear in s) and erase all of its occurrences from the string exactly once. After this removal, you need to divide the resulting string into a sequence of contiguous, non‑empty substrings (segments). The rule for the split is that no single segment may contain the same character more than once. Your goal is to make the number of segments as small as…
Checking your access…