kdn251 / interviews

Everything you need to know to get the job.
https://www.youtube.com/channel/UCKvwPt6BifPP54yzH99ff1g?view_as=subscriber
MIT License
63.47k stars 12.89k forks source link

NPE bugs in MaximumProductOfWordLengths.java and RemoveDuplicatesFromSortedArray.java #156

Open HermioneSW opened 4 years ago

HermioneSW commented 4 years ago

Hi,

I have found two bugs in MaximumProductOfWordLengths.java (leetcode/bit-manipulation/MaximumProductOfWordLengths.java) and RemoveDuplicatesFromSortedArray.java(leetcode/two-pointers/RemoveDuplicatesFromSortedArray.java).

In MaximumProductOfWordLengths.java line 20 if(words.length == 0 || words == null) if words is null, words.length will NPE

Similarly in RemoveDuplicatesFromSortedArray.java line 12 if(nums.length == 0 || nums == null) if nums is null then nums.length will NPE.

I know they are minor issues. I would still be good if you can fix them. Thanks a lot!

HermioneSW commented 4 years ago

Hi, can anyone please confirm and fix those bugs? Thanks so much!

wangpeipei90 commented 4 years ago

You need to create a pull request so the author can merge it directly.

divyani1997 commented 3 years ago

Hi, Can I work on this issue?