Problem Statement
Definition
- Class:
- AlmostPrime
- Method:
- count
- Parameters:
- String, String
- Returns:
- int
- Method signature:
- int count(String A, String B)
- (be sure your method is public)
Constraints
- A will represent an integer between 1 and 10^14, inclusive.
- B will represent an integer between A and 10^14, inclusive.
- Both A and B will have no leading zeros.
Examples
"1"
"10"
Returns: 3
4, 8 and 9 are almost prime here.
"1"
"1000"
Returns: 25
"134"
"53686423"
Returns: 1074
"123"
"346458759636"
Returns: 49439
"1"
"100000000000000"
Returns: 670121
"75746"
"3464578568"
Returns: 6236
"123456789123"
"123456789123"
Returns: 0
"549755813888"
"549755813888"
Returns: 1
"847288609443"
"847288609443"
Returns: 1
"847288609443"
"847288609444"
Returns: 1
"847288609442"
"847288609444"
Returns: 1
"2423"
"43675485656"
Returns: 19383
"5254235"
"43654575"
Returns: 564
"56376578567"
"78456464454"
Returns: 3488
"78697845445"
"78953453452"
Returns: 47
"425346457569"
"458670978097"
Returns: 1907
"1000"
"10000000"
Returns: 530
"214358881"
"137858491849"
Returns: 30637
"3404825447"
"762939453125"
Returns: 64511
"22164362129"
"678223072849"
Returns: 52756
"5324"
"894739"
Returns: 183
"831241"
"21942839423234"
Returns: 331354
"31"
"4289348239423"
Returns: 156158
"70368744177664"
"70368744177664"
Returns: 1
"70368744177665"
"70368744177665"
Returns: 0
"70368744177663"
"70368744177663"
Returns: 0
"35184372088831"
"35184372088831"
Returns: 0
"17592186044415"
"17592186044415"
Returns: 0
"137438953471"
"137438953471"
Returns: 0
"78310985282"
"23298085122480"
Returns: 315626
"68630377364884"
"70368744177663"
Returns: 6571
"412423"
"100000000000000"
Returns: 669946
"1"
"10000000000000"
Returns: 230567
"62710560"
"62710562"
Returns: 1