I want to store all substrings in a unordered_map .I am thinking to use substr
function of stl but it worst case time complexity comes out to be O(n) and when I am going to use inside a loop for all indexes of string it will give me O(n^2).
Can we do something better in O(n) by using pointer or something else so that i can access the substring later.