You can avoid sigsev by alloting arr of size 4*MAX to be on the safe side, I too face this problem sometimes.
Thanks. Will take this into account!
Thanks @skbly7 , we all appreciate the efforts you admins undertake to keep forums clean. And I guarantee you that its MUCH better than what it was before
2 Likes
I just want to add that sometimes you actually need a map instead of an array when the indices to be accessed are very large but we donāt need to calculate all of them. For example, this problem.
2 Likes
Okay, cool idea will implement it, I had solved that problem by saving numbers upto 10^6, if number was greater than 10^6, I had broken the number until it is less than 10^6 and thus produced the max
really thanks to you broā¦it is really helpfullā¦i have also resolved my problemā¦