help with this problem

Правка en2, от Reslan, 2016-08-01 14:41:51

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

Теги #data structure, #strings

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Reslan 2016-08-01 14:41:51 6
en1 Английский Reslan 2016-08-01 14:40:19 640 Initial revision (published)