11496 - Musical Loop
Solution Description : Simple Ad Hoc problem simply iterate through [1 .. N] to see whether you see /\ pattern or \/ pattern, count this as 1 peak. input N and input N number A1 A2 A3 ....... AN You need to check A1 & A2, A2 & A3, ..........,AN-1 & AN, and AN & A1 If you cleaver then do not need to use Array |
||||||||||