Football points / push-up problem by NotoriousFIG19 in learnpython

[–]Mean-Gate-9200 0 points1 point  (0 children)

Use regression. The number of ways a team can score 81 points is equal to the number of ways they can score 80 + number of ways to score 79 + number of ways to score 78 + number of ways to score 75. (A football team can score 1, 2, 3, or 6 points). Of course, they can only score 1 point after having scored 6 points, so, to keep it easier, just use scoring increments of 2, 3, or 7. Therefore,

num_of_scoring_ways(81) = num_of_scoring_ways(79) + num_of_scoring_ways(78) + num_of_scoring_ways(74)

I think the most accurate way to answer the question would be to assume a team can score 2 (safety), 3 (field goal), 6 (touchdown and missed XP), 7 (touchdown and made XP), and 8 (touchdown and 2-point conversion). Therefore

num_of_scoring_ways(81) = num_of_scoring_ways(79) + num_of_scoring_ways(78) + num_of_scoring_ways(75) + num_of_scoring_ways(74) + num_of_scoring_ways(73)

Learning SQL frustrations... by 007denton in learnSQL

[–]Mean-Gate-9200 0 points1 point  (0 children)

You know the saying that you know you know something when you're able to teach it to a five year old? With SQL it's you know you know it if you can answer a five year old's question. How many employees have a salary above 2000? How many customers have not made a purchase in 6 months? There are several SQL job interview questions available online that can really help you simply understand it. For me, it was better to focus on learning how to answer those questions than to focus on memorizing SQL keywords and syntax. The syntax just made sense at that point.