// get goosebumps after listening to the song these many time
Integer gooseBumpsAfter = 4;
// Iterate over the map for a maximum 1000 times
Integer n = 1000;
for(Integer i=1; i<=n; i++){
System.debug('Listening to song ' + i + ' times');
// break the loop if i equals to gooseBumpsAfter
if(i == gooseBumpsAfter){
break;
}
}
Ly8gZ2V0IGdvb3NlYnVtcHMgYWZ0ZXIgbGlzdGVuaW5nIHRvIHRoZSBzb25nICB0aGVzZSBtYW55IHRpbWUKSW50ZWdlciBnb29zZUJ1bXBzQWZ0ZXIgPSA0OwoKLy8gSXRlcmF0ZSBvdmVyIHRoZSBtYXAgZm9yIGEgbWF4aW11bSAxMDAwIHRpbWVzCkludGVnZXIgbiA9IDEwMDA7Cgpmb3IoSW50ZWdlciBpPTE7IGk8PW47IGkrKyl7CiAgICBTeXN0ZW0uZGVidWcoJ0xpc3RlbmluZyB0byBzb25nICcgKyBpICsgJyB0aW1lcycpOwogICAgLy8gYnJlYWsgdGhlIGxvb3AgaWYgaSBlcXVhbHMgdG8gZ29vc2VCdW1wc0FmdGVyCiAgICBpZihpID09IGdvb3NlQnVtcHNBZnRlcil7CiAgICAgICAgYnJlYWs7CiAgICB9Cn0K