diff --git "a/leetcode3/\354\227\274\355\230\234\354\240\225/3014. Minimum Number of Pushes to Type Word I.java" "b/leetcode3/\354\227\274\355\230\234\354\240\225/3014. Minimum Number of Pushes to Type Word I.java" new file mode 100644 index 00000000..7fa244fe --- /dev/null +++ "b/leetcode3/\354\227\274\355\230\234\354\240\225/3014. Minimum Number of Pushes to Type Word I.java" @@ -0,0 +1,15 @@ +// O(n) + +class Solution { + public int minimumPushes(String word) { + int cnt = word.length()/8; + int min = (word.length() % 8) * (cnt + 1); + int i = 1; + while (cnt > 0) { + min += (8 * i); + i++; + cnt--; + } + return min; + } +}