Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
girar la matriz 90 grados en el sentido de las agujas del reloj no funciona correctamente

aquí, después de transponer la matriz, quiero invertir la fila para obtener la rotación de la matriz, pero hasta que la transposición funcione, después de eso no dará el resultado adecuado

 import React from "react"; export default function DropDown() { let matrix = [ [ 1, 2, 3, 4 ], [ 1, 0, 3, 4 ], [ 1, 2, 3, 4 ], [ 1, 2, 3, 4 ], ]; for(let i=0;i<4;i++) { for(let j=0;j<i;j++) {let t; if(i!=j) t=matrix[i][j]; matrix[i][j]=matrix[j][i]; matrix[j][i]=t; } } for(let i=0;i<4;i++) { for(let j=0;j<4/2;j++) {let t; if(i!=j) t=matrix[i][j]; matrix[i][j]=matrix[i][4-j-1]; matrix[i][4-j-1]=t; } } return ( <> {matrix.map(i=><div>{i}</div>)} </> ); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Espero que tu pregunta sea sobre trasposición de matriz.

 const arr = [ [1, 1, 1], [2, 2, 2], [3, 3, 3], ]; const transpose = arr => { for (let i = 0; i < arr.length; i++) { for (let j = 0; j < i; j++) { const tmp = arr[i][j]; arr[i][j] = arr[j][i]; arr[j][i] = tmp; }; } } transpose(arr);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!