leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

Is this a bug with “Longest Substring Without Repeating Characters”?

Open wangkuiyi opened this issue 6 years ago • 1 comments

https://github.com/haoel/leetcode/blob/725a380d5c2644dfadb5498dd3ec8596b5e59618/algorithms/cpp/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp#L47

I’d thought that memset initialize bytes but not integers?

wangkuiyi avatar Feb 26 '18 19:02 wangkuiyi

Setting all the bytes of a integer to -1 (0xFF) results in the integer becoming 0xFFFFFFFF (-1).

Dev-XYS avatar Apr 01 '18 05:04 Dev-XYS