AC. The below statement should have been outside the else block :-(
currentlyAvailableProblems += available[i];