I'm going over some array problems on Leetcode and when I tried to submit my answer I got an empty result as my answer. I'm not sure why it's happing. I tried to run this function in Chrome DevTools and it works as expected. Any hints would be appreciated.

/**
* @param {number[]} nums
* @return {number}
*/
function removeDuplicates(nums) {
return nums.filter((n, index) => nums[index] != nums[++index])
}
Link to the problem: https://leetcode.com/explore/interview/card/top-interview-questions-easy/92/array/727/
Ok this is strange because I went and even logged to the console.log my correct answer but the return is.. very strange.. so far it seems that this is not your fault
I even tried making the return be a string and it still shows this empty array.. it's strange FOR REAL

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With