Tag: Interview
-
Google Interview 686. Repeated String Match
Google Interview 686. Repeated String Match. Given two strings a and b, return the minimum number of times you should repeat string a so that string b becomes a subscring of sring a.If b cannot be a substring of a after repeating it, return -1. String “acb” repeated 0 times is “”, repeated 1 times…
-
Two Sum Solution [LeetCode 1]
Two Sum Solution in Python 3 [LeetCode 1] Given an array of integers nums and a target integer. Return the indexes (not values) of the 2 numbers that add up to the target value. One solution and one element can’t be used twice. Example nums = [1,2,8,7,11,15], target = 13 output= [1,4], indexes start at…
-
LeetCode 482 License Key Formatting Solution
LeetCode 482 License Key Formatting Solution in Python 3. LeetCode 482 Solution 32 ms in Python 3 You are given a license key represented by the string s that contains only alphanumeric characters and dashes. You are also given an integer k. Reformat the string s so that each group contains exactly k characters, except…