September 28, 2023
Latest:
TechInfo

# Secret Code CodeKaze June23 Round 2 Solution || India’s Biggest Hiring Challenge

## Problem Statement

#### Return ‘1’ if the array contains the ‘secret code’ and return ‘0’ otherwise.

##### For Example :
``````Let 'N' = 4, 'A' = [ 10, 11, 21, 8 ].
There are two sets of three consecutive elements in the given array.
The first, second, and third elements make the first set, with a sum of '10 + 11 + 21 = 42', which is not divisible by '10'.
The second, third, and fourth elements make the second set, with a sum of '11 + 21 + 8 = 40', which is divisible by '10'. Therefore, the array does contain the 'secret code'.
``````
##### Hint:
``````Iterate through each array element and check if the last three elements are considered the 'secret code' by finding their sum and checking its divisibility by 10.
``````
Detailed explanation ( Input/output format, Notes, Images )
##### Constraints :
``````1 <= 'T' <= 10
3 <= 'N' <= 10^5
1 <= 'A[i]' <= 10^8

Time Limit: 1 sec
``````
##### Sample Input 1 :
``````2
5
1 2 3 4 1
4
30 10 20 10
``````
##### Sample Output 1 :
``````0
1
``````
##### Explanation Of Sample Input 1 :
``````First test case:-
There are three sets of three consecutive elements in the given array.
The sums of all three sets are less than '10'.

Second test case:-
Every element is divisible by '10'.
Therefore, the sum of any three consecutive elements will be divisible by '10'.
``````
##### Sample Input 2 :
``````2
3
1082 1 1037
4
34 225 17 9
``````
##### Sample Output 2 :
``````1
0``````

6 digit code appear after 69 seconds.

Wait for Solution