Range query problem

no of integers between l and r such that binary representation of integer contains pattern 101

constraint : l<=r<=1e18

asked in past gfg hiring contest

pls share approach

@anon55659401 @vijju123 pls share approach

search digit dp. Its standard problem


Here Is a good video on Digit DP. might help you.

pls explain the approach behind this problem using digit dp !!