Number of perfect cubes between two given numbers | Function to count cubes between two numbers ; Driver code
function countCubes ( a , b ) { return ( Math . floor ( b ** ( 1. / 3. ) ) - Math . ceil ( a ** ( 1. / 3. ) ) + 1 ) } let a = 7 ; let b = 28 ; document . write ( " " + countCubes ( a , b ) )