Get Maximum Information Gain
Problem Overview
- Find the maximum information gain from any pair of strings, defined as the absolute length difference, subject to a limit on shared characters (≤ max_common_features).
- Input: dataSet[] of lowercase strings and integer max_common_features; Output: int maximum gain; Constraints: 2 ≤ n ≤ 1000, 1 ≤ len ≤ 1000.
- Models selecting data points for model training while minimizing overlapping features.
- An Amazon interview question for a coding interview; a string-processing problem asked in Amazon interviews.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
