Tag: Interview questions
412. Fizz Buzz Python 3 Solution
412. Fizz Buzz Python 3 Solution for LeetCode and HackerRank problems Requirements Input: integer n Output: string array answer (1-indexed) where: answer[i] == “FizzBuzz” when i is divisible by both 3 and 5. answer[i] == “Fizz” when i is divisible by 3. answer[i] == “Buzz” when i is divisible by 5. answer[i] == i for…
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…
Google 844. Backspace String Compare
Google Interview 844. Backspace String Compare Given two strings s and t, return True if they are equal. ‘#’ means backspace. Examples Input: s = “ab#c”, t = “ad#c” Output: true Explanation: Both s and t become “ac”. Input: s = “abb#c”, t = “ade#c” Output: false Explanation: s becomes “abc” and t becomes “adc”.…
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…
Google Leetcode 929 Unique Email Addresses
Google Interview Questions – Leetcode 929 Unique Email Addresses Fast Solution Level: Easy Analysis Every valid email has a local name and the domain name separated by @ symbol. Dots in the local name are removed when checking for uniqueness. any character after the + sign is ignored. Domain names are left as they are…