Hey all , I am having a doubt I recently solved one question of LCS (“LCS Returns | HackerRank”)
0if I create a 2d int array of size 5000 X 5000 , it showing me error , while 2D vector of same size having no issues why ?
@ssjgz please help
“https://leetcode.com/playground/6njSynqW”
AddressSanitizer:DEADLYSIGNAL
=================================================================
==33==ERROR: AddressSanitizer: stack-overflow on address 0x7ffd3029afb8 (pc 0x000000342f95 bp 0x7ffd361f9190 sp 0x7ffd3029afc0 T0)
#2 0x7f1d7ccfb0b2 (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
==33==ABORTING
if I replace
int dpleft[len1][len2];
to
vector<vector<int>> dpleft( len1 , vector<int> (len2, 0));
It is fine why ?