I believe your new solution fails when secret = '0011', guess = '1100' because for (char in gHash) iterates through object keys, which means your function only returns 2 partials, instead of 4.
You can find the exact question here leetcode.com/problems/bulls-and-cows/ along with test cases and solutions.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I believe your new solution fails when secret = '0011', guess = '1100' because for (char in gHash) iterates through object keys, which means your function only returns 2 partials, instead of 4.
You can find the exact question here leetcode.com/problems/bulls-and-cows/ along with test cases and solutions.