You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Binary Index Tree implementation, the length of the tree should be one greater than the length of the original array (nums) . However, your code is the same .
// @ 63-64 line
vector <int> f(sorted.size());
fenwick = f;
I think this will lead to some memory overflow issues. So, I modifies the size of f to sorted.size() + 1. It works in leetcode.
The text was updated successfully, but these errors were encountered:
Hi, there.
In the Binary Index Tree implementation, the length of the tree should be one greater than the length of the original array (
nums
) . However, your code is the same .I think this will lead to some memory overflow issues. So, I modifies the size of
f
tosorted.size() + 1
. It works in leetcode.The text was updated successfully, but these errors were encountered: