← All problemsSign in

Yet Another Counting Problem

You are given a grid of size $N$ X $M$. Each element of the grid is a digit from $1-9$. You need to count the number of sub-grids of the given grid such that one can get a number, consisting of all the digits of the sub-grid, which is both a $palindrome$ and divisible by $6$. ###Input: - The First line contains $N,M$, the dimensions of the grid. - $N$ lines follow, each containing a string of $

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start