Judging mistake

• My code didn't get accepted because the 2nd note constraint was not obeyed when checking my submissions

• ``````from collections import Counter as ctr
class Solution(object):
def getDeg(self,nums,start,end):
ct = {}
for i in xrange(start,end):
ct[nums[i]]=ct.get(nums[i],0)+ 1
return max(ct.values()+[0])

def find(self,nums,val,rev=False):
it = xrange(len(nums)-1,-1,-1) if rev else xrange(len(nums))
for i in it:
if nums[i]==val:
return i
return -1

def findShortestSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
n =len(nums)
freqs = {}
first,last = [-1]*50000, [-1]*50000
for i,v in enumerate(nums):
if first[v]<0:
first[v]=i
freqs[v]=1
else:
freqs[v]+=1
last[v] = i

d= max(freqs.values())
mvd = set([i for i in freqs if freqs[i]==d])
ans =n
for v in mvd:
if first[v]>=0:
ans = min(ans,1+last[v]-first[v])
return ans
`````````

• @hliu94 Me too i had two WA because of the second constraint: 0<= nums[i] <= 49999, then I supposed that the right constraint was 0 <= abs(nums[i]) <= 49999. Fortunately my solution supposing that nums[i] is 32-bit integer gave accepted

• Same here.
Solution with the constraint is simpler, which made me wondering:
how did those people who scored without retries knew that input could be an arbitrary int..

• @hliu94 @balabasik Extremely sorry about this. The inputs have been changed to be valid, and the question will be rejudged.

@balabasik Some solutions use HashMap instead of array. For an example, please visit https://leetcode.com/articles/degree-of-an-array/ .

• All submissions for question 1. have been rejudged and the scoreboard have also been recalculated. Your solution is accepted now.

`Partition to K Equal Sum Subsets` lacks some case.