3014. Minimum Number of Pushes to Type Word I
View on LeetCode ↗
C++
class Solution {public: int minimumPushes(string word) { return min(static_cast<int>(word.length()), 8) + min(clamp(static_cast<int>(word.length()) - 8, 0, 99999) * 2, 16) + min(clamp(static_cast<int>(word.length()) - 16, 0, 99999) * 3, 24) + min(clamp(static_cast<int>(word.length()) - 24, 0, 99999) * 4, 32); }};
was just simple math stuff, could have done better way with blocking but i just got this done.