you wanted small time complexity, I give you O/(1) against O/(k^t) space complexity