freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-360-scary-sphere.md

1.1 KiB
Raw Blame History

id challengeType videoUrl title
5900f4d41000cf542c50ffe7 5 问题360可怕的球体

Description

给定三维空间中的两个点x1y1z1x2y2z2这些点之间的曼哈顿距离定义为| x1-x2 | + | y1-y2 | + | z1-z2 |。

令Cr为半径为r且在原点O0,0,0中心的球体。设Ir是Cr表面上具有整数坐标的所有点的集合。设Sr是Ir的所有元素与原点O的曼哈顿距离之和。

例如S45= 34518。

找到S1010

Instructions

Tests

tests:
  - text: <code>euler360()</code>应该返回878825614395267100。
    testString: assert.strictEqual(euler360(), 878825614395267100);

Challenge Seed

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

euler360();

Solution

// solution required

/section>