Problem Statement:
Given a Salesforce workflow configuration string config consisting of digits (0-9) and placeholders (?), determine the number of ways the placeholders can be replaced with digits (0-9) such that no two adjacent workflow steps (digits) are the same.
Since the answer can be very large, return the answer modulo 10^9 + 7.
Example:
config = "1?3?"
This results in a total of 72 possible configurations.
Problem Statement:
Salesforce provides a secure system for organizations to manage their accounts and data. A password is considered safe if it satisfies the following criteria:
Given the integers n (password length) and k (maximum allowed consecutive identical characters), calculate the total number of distinct safe passwords that can be generated. Since the number can be large, return the result modulo 10^9 + 7.
Example:
n = 2, k = 2
The total number of passwords of length 2 is 26 \times 26 = 676. There are 26 cases where k=2 consecutive characters are the same (e.g., "aa", "bb"). Thus, the answer is 676 - 26 = 650. Output is 650.
Problem Statement:
A Salesforce administrator is working on optimizing data collection for Opportunity records across multiple branches. The branches follow a hierarchical structure, forming a tree with n nodes labeled from 0 to n-1.
An array opportunityData of size n indicates whether a branch contains important Opportunity data. Specifically, opportunityData[i] is 1 if branch i holds relevant data and 0 otherwise.
To gather all Opportunity data, the admin must navigate through the branches using bidirectional paths (edges). The goal is to minimize the total distance traveled. Any data within a radius of 2 edges from a branch can be collected. For system consistency, the retrieval process must start and end at the same branch.
Determine the minimum number of edges the admin needs to traverse to collect all Opportunity data.