please check dont know how to resolve this error
Compilation errpor
Hi @Aparna firstly you are taking input of arrays wrong, you have to first take input of complete array1 and then array2, you are doing it simultaneously. Secondly, if the value you are trying to access in the map, does not exist then you cannot “increment” it by m[a[i]]++ because there is no pre-existing value to increment, so you can use an if condition and set value to 1, if it does not exist, otherwise increment it.
did you check my compilation error ? i guess its nthing to do with this problem also i m just counting freq of every eleemnt in that loop , it should work fine. i have written the same freq code earlier it was correct
@Aparna yes your compilation error says error: no match for call to ‘(std::map<int, int>) (int&)’
m(arr2[i])–;
^
and i think this is the reason. Try resolving it, let me know if it still persists
i resolved my error it was smthng related to brackets, thankyou very much 