This repository contains a solution to the following problem:
having N numbers a_1, ..., a_N do preprocessing in O(NlogN) time and then answer the following question in O(logN) time: how many different (unique) numbers are there amoung a_x, ..., a_y for arbitrary [x, y].
Proposed solution uses "rope" data structure with implementation suggested by Eugene Kirpichov.