Please help me understand where I went wrong on this one.  My output from 
the test data seemed to match the test output exactly so I'm not sure if it 
was some formatting I was missing or a hidden corner case but every 
submission I made returned WA.

Thanks,
Scott

*t = int(input())*
*for i in range(0, t * 2, 2):*
*    n = input()*
*    m = [int(x) for x in input().split()]*
*    peaks = 0*
*    before, current, after = m[0], m[1], m[2]*
*    for j in range(1, len(m) - 1):*
*        if before < current and current > after:*
*            peaks += 1*
*        before, current, after = current, after, m[j]*
        
*    print("Case #{}: {}".format(str(int(i/2 + 1)), str(peaks)))*



Returns:

Case #1: 1
Case #2: 0
Case #3: 2
Case #4: 0

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/f5b0673b-114e-4259-890b-22914ec33ab2%40googlegroups.com.

Reply via email to