Overall pretty easy, with plenty of time to spare. The first two problems have no complexity requirement, pure brute force is fine, and the algorithm for the third one isn't hard either.
Given an array, you can change the value of any three numbers. What is the smallest possible difference between the max and the min?
Given a string made of lowercase letters, define a balanced string as one where every letter appears with equal frequency. Find the length of the longest balanced substring.
Given an array representing a company's income (positive) and expenses (negative), the company's balance can never go negative at any point in time. You can move expenses to the end of the year. What is the minimum number of expenses you need to move? The sum of the whole array is guaranteed to be >= 0. n <= 1e5.
Discussion
Loading comments…