Simple and Easy Java Solution || Beats 99% || With intuition and approach 
🔍 Intuition:
The given binary array represents a number whose digits are read sequentially.
We need to check if the number formed by the prefix (from index0toi)
## 🔍 Intuition:
- The given binary array represents a number whose digits are read sequentially.
- We need to check if the number formed by the prefix (from index `0` to `i`) is divisible by `5`.
- Instead of converting the entire prefix into an integer (which may cause overflow for large inputs), we can maintain the remainder when divided by `5`.
- Using the property:  
  - If `(A * 2 + B) % 5 == 0`, then the number is divisible by `5`.

---

## 🛠️ Approach:
1. **Initialize `num = 0`**, which will store the remainder of the number formed so far.
2. Create a **list of Boolean values** to store results for each prefix.
3. **Iterate through `nums`**:
   - Update `num` using the formula:  
     \[
     num = (num \times 2 + \text{ele}) \% 5
     \]
   - Check if `num == 0`, meaning the prefix is divisible by `5`.
   - Add the result (`true` or `false`) to the list.
4. **Return the list** containing results for all prefixes.

---

## ⏱️ Complexity Analysis:
- **Time Complexity:**  
  - We iterate through the `nums` array **once**, performing **O(1)** operations per element.  
  - **Overall: O(N)**, where `N` is the length of `nums`.
  
- **Space Complexity:**  
  - We store `N` boolean values in the list.  
  - **Overall: O(N)** for the output list.


# Code
```java []
class Solution {
    public List<Boolean> prefixesDivBy5(int[] nums) {
        int num = 0;
        ArrayList<Boolean> list = new ArrayList<>();
        for(int ele: nums){
            num = (num * 2 + ele)%5;
            list.add(num==0);  
        }
       return list; 
    }
}
```
['Array', 'Bit Manipulation', 'Java']