1. Almost Equivalent Strings
Two strings are considered 'almost equivalent' if they have the same length and for each lowercase letter, the number of occurrences of that letter in the two strings differs by no more than 3. Given two arrays of strings, s and t, where s[i] and t[i] form a pair, determine if they are almost equivalent. Return an array of strings, either 'YES' or 'NO', one for each pair.
2. Triangle Area Calculation
Given 3 sets of distinct coordinates that form a triangle, determine the area of the triangle. At least one of the sides will be parallel to the x or y axis. For example, with coordinates (0,0), (3,5), and (0,2), the base of the triangle is 2, and the height is 3. The area of a triangle is (base * height)/2, so the area for this example is 3 * 2/2 = 3. Write a function 'getTriangleArea' that takes the coordinates as input and returns the area of the triangle. The input will always consist of 3 sets of coordinates.
3. Calculate Score Difference
Write a function 'getScoreDifference' that accepts an integer 'num' representing the total number of scores of the first and second player. Suppose the first score and second score are the 2nd and 3rd elements of the sequence [3, 62, 25]. The goal is to calculate the value of the first score minus the second score. The result for this sequence would be 62 - 25 = 37. Implement the function and provide a description of its parameters and return value.
4. Stock Price Average Calculation
Design a Python class to update the average stock price. Each time a new stock price is added, the average price needs to be recalculated. Follow-up: Calculate the average value of the past ten days. Discuss the time complexity and space complexity of each step and write some test cases.
5. Understanding Weighted Average Cost of Capital (WACC)
What is the finance term WACC (weighted average cost of capital), its definition, and how do you calculate it?