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
When the slice's length is 0, should directly return to prevent false
result or slice out of bounds runtime error
zino23
changed the title
ex4.5: slice with length 0 will yield wrong results, and capacity 0 will cause the program to panic
bug(ex4.5): slice with length 0 will yield wrong results, and capacity 0 will cause the program to panic
Jun 4, 2022
len(s)
is 0,unique
will returns[:1]
, which is not correctcap(s)
is 0, the program will panic because of slice out of bounds errorThe text was updated successfully, but these errors were encountered: