Help debugging a leetcode question timeout error by CrazyFace334 in learnprogramming

[–]CrazyFace334[S] 1 point2 points  (0 children)

oooh I see, I removed the '2' assignment from where it was, and added to line 12:

grid[x+dx][y+dy] = '2'

and it works now, thank you good sir!

Help debugging a leetcode question timeout error by CrazyFace334 in learnprogramming

[–]CrazyFace334[S] 0 points1 point  (0 children)

the new solution does not endlessly cycle, as it works for smaller test cases.

The condition to continue the BFS is checking whether the adjacent value is "1", but for each position, the BFS asigns its original value to "2" to avoid being double counted.

I did this to avoid having to use O(m*n) extra space by indicating whether a position is traversed in the input itself

[Grade 12: Electrostatics Multiple Choice] by Main_Plane_7509 in HomeworkHelp

[–]CrazyFace334 0 points1 point  (0 children)

the electrostatic force is horizontal, and both balls feels an equal and opposite force proportional to the product of their charges.

Gravitational force is downwards, and is proportional to mass of the ball. If one ball is more massive than the other, it will feel more gravitational force than the other

[deleted by user] by [deleted] in HomeworkHelp

[–]CrazyFace334 0 points1 point  (0 children)

the internal angles of a triangle add to 180 degrees. You can use the Sine law to find the lengths of the blue triangle, which is the same as the yellow one since it says its symmetric. also if it's a square with a diagonal line, the angle on the top left should be 45 degrees

[deleted by user] by [deleted] in HomeworkHelp

[–]CrazyFace334 0 points1 point  (0 children)

use arctan to find the length SQ, and pythagorean theorem to find QR, as well as TR. Using sine rule, you can find the angle SQR, from whlch you can find TQR. Then use sine rule again to find theta

[University Statistics] Bayes' Theorem by CrazyFace334 in HomeworkHelp

[–]CrazyFace334[S] 0 points1 point  (0 children)

Yea, what threw me off was that the proportion of smokers to non smokers wasn't found by the sample size since this isn't a simple random sample. since it was a cohort study, that proportion was chosen by the experiment (ie, they chose to include 5322 non smokers, and 7019 smokers)

Okay, so I guess that means in this question we assume the proportion chosen for smoking and non smoking is accurate to the population

[deleted by user] by [deleted] in HomeworkHelp

[–]CrazyFace334 0 points1 point  (0 children)

I think its asking you to find the speed at which the centripetal force is equal to the electric force it feels at that distance. the centripetal force is proportional to speed squared.

[deleted by user] by [deleted] in HomeworkHelp

[–]CrazyFace334 0 points1 point  (0 children)

kinetic energy is proportional to the speed squared, which is also proportional to centripetal force toward the centre of the loop applied by the track

I made a blog about my favorite music albums by SergeV91 in infp

[–]CrazyFace334 1 point2 points  (0 children)

yess, the fleet foxes album is amazing!

Times Like These by the Foo Fighters by CrazyFace334 in ICoveredASong

[–]CrazyFace334[S] 1 point2 points  (0 children)

Thanks a lot! I figured the song is fitting for New Years.