I tried the Min Max string using Hashing . I first calculated the hash value of all the Initial string. Then I created a map . Then I compared the hash value of the last character of each string with every other string and if it didn’t matched with anyone inserted it in the map. Then I went to the queries , if query is of 1st type, I took the value of the hash of the last character of the given string and computed its hash after ammending it with given letter.Then I erased the string from the map which is used to create the new string as old string would be a proper prefix of new one. Then I compared the hash value of new string with every other string present in the map whose size is greater than new string.
If query is of 2nd or 3rd type I simple printed the first and last value.
It is showing SIGSEGV . Please Help . Your help will be really appreciated.
Link to My solution