Show HN: Astro-Bot – A programming question with every new tab
11–20 of 22 posts
Re: Show HN: Astro-Bot – A programming question with every new tab
#12Re: Show HN: Astro-Bot – A programming question with every new tab
#13Is there a Firefox version?
Re: Show HN: Astro-Bot – A programming question with every new tab
#14#include int main() { int array[] = { 1, 2, 3, 4, 5}; int *ptr; ptr = a; ptr++; return 0; } This won't compile, but the answer says it should be 2
Re: Show HN: Astro-Bot – A programming question with every new tab
#15Nice! It would be cool if there was some kind of points to denote how many questions we have answered correctly.
Is a leaderboard something that would appeal to you?
Re: Show HN: Astro-Bot – A programming question with every new tab
#16I enjoyed it, but you should allow me to disable random HackerNews links. That's not the purpose of the extension.
Re: Show HN: Astro-Bot – A programming question with every new tab
#17 func foo( _ nums: [Int] ) -> Int {
var sum = 0
var _ = nums.map {sum += $0}
return (nums.count * ((nums.count+1) / 2)) - sum
}
The last line should be return ((nums.count+1) * ((nums.count+2) / 2)) - sum
The count of nums will give the incorrect answer since it's already missing a value.Re: Show HN: Astro-Bot – A programming question with every new tab
#18The following is incorrect for finding a missing number in a sequence. func foo( _ nums: [Int] ) -> Int { var sum = 0 var _ = nums.map {sum += $0} return (nums.count * ((nums.count+1) / 2)) - sum } The last line should be return ((nums.count+1) * ((nums.count+2) / 2)) - sum The count of nums will give the incorrect answer since it's already missing a value.
Re: Show HN: Astro-Bot – A programming question with every new tab
#19 $ git checkout -b feature
The answer to this is wrong -- got green on "merge two branches" rather than "create and then checkout a new branch called 'feature'".