{"action":"created","issue":{"url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1206","labels_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1206/labels{/name}","comments_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1206/comments","events_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1206/events","html_url":"https://github.com/FreeCodeCamp/freecodecamp/issues/1206","id":93146265,"number":1206,"title":"Solution accepted does not correctly account for case where num < arr[0]","user":{"login":"aliceafriedman","id":11845817,"avatar_url":"https://avatars.githubusercontent.com/u/11845817?v=3","gravatar_id":"","url":"https://api.github.com/users/aliceafriedman","html_url":"https://github.com/aliceafriedman","followers_url":"https://api.github.com/users/aliceafriedman/followers","following_url":"https://api.github.com/users/aliceafriedman/following{/other_user}","gists_url":"https://api.github.com/users/aliceafriedman/gists{/gist_id}","starred_url":"https://api.github.com/users/aliceafriedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliceafriedman/subscriptions","organizations_url":"https://api.github.com/users/aliceafriedman/orgs","repos_url":"https://api.github.com/users/aliceafriedman/repos","events_url":"https://api.github.com/users/aliceafriedman/events{/privacy}","received_events_url":"https://api.github.com/users/aliceafriedman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-05T20:51:59Z","updated_at":"2015-07-06T00:34:06Z","closed_at":"2015-07-05T22:29:59Z","body":"Challenge http://www.freecodecamp.com/challenges/bonfire-where-do-i-belong has an issue.\r\n\r\nThe Bonfire will accept a solution as correct that doesn't work in cases where num < arr[0]. \r\n\r\nThis accepted solution will give you the wrong answer in such a case (1, instead of 0).\r\n\r\n![screen](https://cloud.githubusercontent.com/assets/11845817/8513368/1fcc133e-2336-11e5-8214-c74a2279184e.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/comments/118682729","html_url":"https://github.com/FreeCodeCamp/freecodecamp/issues/1206#issuecomment-118682729","issue_url":"https://api.github.com/repos/FreeCodeCamp/freecodecamp/issues/1206","id":118682729,"user":{"login":"benmcmahon100","id":10749142,"avatar_url":"https://avatars.githubusercontent.com/u/10749142?v=3","gravatar_id":"","url":"https://api.github.com/users/benmcmahon100","html_url":"https://github.com/benmcmahon100","followers_url":"https://api.github.com/users/benmcmahon100/followers","following_url":"https://api.github.com/users/benmcmahon100/following{/other_user}","gists_url":"https://api.github.com/users/benmcmahon100/gists{/gist_id}","starred_url":"https://api.github.com/users/benmcmahon100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmcmahon100/subscriptions","organizations_url":"https://api.github.com/users/benmcmahon100/orgs","repos_url":"https://api.github.com/users/benmcmahon100/repos","events_url":"https://api.github.com/users/benmcmahon100/events{/privacy}","received_events_url":"https://api.github.com/users/benmcmahon100/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T00:34:06Z","updated_at":"2015-07-06T00:34:06Z","body":"The issue is related to the fact that a do while executes at least once so at the very start your do causes num to be 1. This the difference between the do while and all other loops which is why the error never showed up. So any other loop or recursion or even setting num to -1 would make your code satisfy the 0 index issue but I wouldn't recommend it! Over it's just a quirk of using do while."}}