Hello everyone :D I'm given a string s of length n , letters could be uppercase or lowercase. and I need to answer a query of the type : given ( left , right ) ( where left <= right ) count the number of distinct letters in the range [ left , right ] , for example if s = bcAAcbc , n = 7 , query( 0 , 2 ) = 3 , query( 2 , 3 ) = 1, NOTE : by distinct I mean either different letters , or the same letter but the first one is uppercase and the second is lowercase , for instance a and A are distinct , a and b also distinct , A and A are NOT could this problem be solved using segment tree ? thank in advance :D



