Company: visa_6oct
Difficulty: medium
Alien Code Substrings Divisible by 3 Problem Description Imagine you're part of a team analyzing fictional alien technology logs. You have a string alienCode , which represents activity codes from their devices. Your task is to examine this string and count how many substrings of this code represent numbers evenly divisible by 3. It's important to note that none of these substrings should start with zero unless the substring is the character "0" itself. Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(alienCode.length³) will fit within the execution time limit. A string of digits representing alien device activity codes. Input: string alienCode Output: integer (Return the number of substrings that form an integer divisible by 3.) Examples Example 1: Input: alienCode = "456" Output: 3 Explanation: Consider all substrings of the given string: alienCode[0..0] = 4 isn't divisible by 3. alienCode[1..1] = 5 isn't divisible