Back to All Games
Code Quest: Algorithm Realm +100 XP
MISSION BRIEFING • LEVEL 1
Level 1: The Token Counter
Write a function `estimateTokens(text)` that returns the approximate number of tokens in a string. Assume 1 token is approximately 4 characters (rounded up to nearest integer using Math.ceil). If the text is empty or falsy, return 0.
Need a tactical hint?
JAVASCRIPT SANDBOX