Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WDPTIA102021 - OSWALDO AVILES#2591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

oswaldoavilesib
Copy link

No supe como completar la iteración#5 utilizando IndexOf. Sin embargo, utilice .includes() y funcionó (al parecer).

Intenté los bonus finales pero no me quedo muy claro el concepto de los gris y matrix. Estaría muy bueno verlo en clase, si es posible.

@oswaldoavilesib
Copy link
Author

Se me paso un detalle. Al correr el npm run test:watch me apareció un "Fail", pero me puse a leerlo y aparentemente era porque había una variable ya declarada (la de una iteración y su respectivo bonus eran las mismas).

@ta-web-mexpt2
Copy link

Muy bien pues resolver con una sola manera no siempre es lo mejor el inlcudes como busca la palabra sonbe la que pasaste fue un buen hack te dejamos como los reyes magos el resultaqdo del final matrix por tu esfuerzo
🥇

function greatestProduct(matrix) {  let product = 0;  const numberOfRows = matrix.length;  const numberOfCols = matrix[0].length;  for (let i = 0; i < numberOfRows; i++) {    let row = matrix[i];    for (let e = 0; e < numberOfCols - 3; e++) {      let rowProduct = row[e] * row[e + 1] * row[e + 2] * row[e + 3];      if (rowProduct > product) {        product = rowProduct;      }    }  }  for (let i = 0; i < numberOfCols; i++) {    for (let e = 0; e < numberOfRows - 3; e++) {      let columProduct = matrix[e][i] * matrix[e + 1][i] * matrix[e + 2][i] * matrix[e + 3][i];      if (columProduct > product) {        product = columProduct;      }    }  }  return product;}

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@oswaldoavilesib@ta-web-mexpt2

[8]ページ先頭

©2009-2025 Movatter.jp