This project is a demo for solving Amazon's coding exercises, using during their recruiting process.
QUESTION A Coding exercise: Find the first character in a stream which is not repeated in the rest of the stream. Please note that you are being provided a stream as a source for these characters. The stream is guaranteed to eventually terminate (i.e. return false from a call to the hasNext() method), though it could be very long. You will access this stream through the provided interface methods. A call to hasNext() will return whether the stream contains any more characters to process. A call to getNext() will return the next character to be processed in the stream. It is not possible to restart the stream. Example: Input: aAbBABac Output: b In this example, the character ‘b’ is the first character in the stream which is not repeated in the stream.
QUESTION B Coding exercise: Every athlete is characterized by his mass 'm' (in kg) and strength 's' (in kg). You are to find the maximum number of athletes that can form a tower standing one upon another. An athlete can hold a tower of athletes with total mass equal to his strength or less than his strength. Input contains the number of athletes n and their parameters. These inputs can be assumed to be passed as arguments (Integer n and List<Pair<Integer, Integer>> parameterList) appropriate for your language of choice.