[Solved] How to solve this (http://codingbat.com/prob/p168357) ‘codingbat’ example efficiently?


This answer will tell you how to do it, but will not give you the code. Writing the code is for you to do, since you chose at accept the challenge on CodingBat.

More efficiently solution: Only iterate the array once. If current element is a 7, and previous element or the one before it is also a 7, return true.

5

solved How to solve this (http://codingbat.com/prob/p168357) ‘codingbat’ example efficiently?