We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 896712a commit 02ed123Copy full SHA for 02ed123
05-Problem-Solving-Patterns/12-Get-Visible-Shapes-Optimized.js
@@ -17,9 +17,9 @@ function getVisibleMountains(triangles) {
17
};
18
}
19
20
- for (const i in triangles) {
21
- const left = triangles[i][0] - triangles[i][1];
22
- const right = triangles[i][0] + triangles[i][1];
+ for (const [i, triangle] of triangles) {
+ const left = triangle[0] - triangle[1];
+ const right = triangle[0] + triangle[1];
23
24
for (const j in triangles) {
25
if (i === j) {
0 commit comments