freeCodeCamp/curriculum/challenges/spanish/08-coding-interview-prep/project-euler/problem-91-right-triangles-...

1.2 KiB

id challengeType title videoUrl localeTitle
5900f3c71000cf542c50feda 5 Problem 91: Right triangles with integer coordinates Problema 91: triángulos rectángulos con coordenadas enteras

Description

Los puntos P (x1, y1) y Q (x2, y2) se trazan en coordenadas de enteros y se unen al origen, O (0,0), para formar ΔOPQ.

Hay exactamente catorce triángulos que contienen un ángulo recto que se puede formar cuando cada coordenada se encuentra entre 0 y 2 inclusive; es decir, 0 ≤ x1, y1, x2, y2 ≤ 2.

Dado que 0 ≤ x1, y1, x2, y2 ≤ 50, ¿cuántos triángulos rectos pueden formarse?

Instructions

Tests

tests:
  - text: <code>euler91()</code> debe devolver 14234.
    testString: 'assert.strictEqual(euler91(), 14234, "<code>euler91()</code> should return 14234.");'

Challenge Seed

function euler91() {
  // Good luck!
  return true;
}

euler91();

Solution

// solution required