Answer: UST GET OA 2025 | Health-Tech Signal Packet Validation | Longest Repeating Chara
Answer · Posted Jun 2026
Solution - Health-Tech Signal Packet Validation Approach Use a Sliding Window while maintaining the frequency of every character inside the current window. Let the most frequent character inside the window appear maxFrequency times. The remaining characters must be replaced. A window is valid if: (window length − maxFrequency) ≤ K If the window becomes invalid, shrink it from the left until it becomes valid again. Track the maximum valid window length throughout the traversal. Code public class HealthTechSignalPacketValidation { public ...
The full answer & interview discussion are available to premium members.
Log in Create a free account