Format: three questions, 90 minutes. It is proctored, you have to keep your camera on, and they record your screen too.
-
Given a String, return the number of words in it. Example: He has 1 million do[[ars, isnt he?
The steps in the problem statement are: first split the String on spaces into words, then throw out any word that contains digits or symbols other than punctuation (comma, period, question mark, exclamation mark). So in this example you need to throw out 1 and do[[ars. Return 5. -
A meeting room variant. The schedules of several people are given as a List<String>, for example "Sam sleep 02:00 10:00" and "Lilly exercise 12:00 12:59". You are also given the meeting length as an int k, and you return the earliest time a meeting can start. In this example, if k is 180 you need to return "13:00", if k is 90 you need to return "10:01", and if there is no suitable time in the day, return "-1". The return type is String.
-
Given an array, for example [2, 1, 4, 3], you can swap any two elements, but each element can be swapped at most once. Make the sum of array[i] * i as large as possible and return the sum.
Discussion
Loading comments…