Coder Social home page Coder Social logo

tips-mod-3-js-checksum-london-web-111918's Introduction

Spreadsheet Savior

Introduction

You've been sucked into a computer! In this foreign, virtual landscape you see a glowing humanoid shape yelling in your direction. "HEY You! Your state seems to be idle. Come help us repair the corruption in this spreadsheet - if we don't hurry, we'll have to display a pinwheel cursor!"

Problem Statement

The spreadsheet consists of rows of seemingly-random numbers. To make sure the recovery process is on the right track, they need you to calculate the spreadsheet's checksum.

For each row, determine the difference between the largest value and the smallest value; the checksum is the sum of all of these differences.

Example

Here's an example of a spreadsheet:

let data = [
  [2, 3, 7, 8],
  [0, 1, 3],
  [9, 2, 8, 3]
]
  • The first row's largest and smallest values are 2 and 8, their difference is 6.
  • The second row's largest and smallest values are 0 and 3, their difference is 3.
  • The third row's difference is 7.

In this example, the spreadsheet's checksum would be 6 + 3 + 7 = 16.

Create a function to find the checksum of the following.

let data = [
  [409, 194, 207, 470, 178],
  [454, 235, 333, 511, 103],
  [474, 293, 525, 372, 408],
  [428, 4321, 2786, 6683, 3921],
  [265, 262, 6206, 2207, 5712]
]

tips-mod-3-js-checksum-london-web-111918's People

Contributors

maxcell avatar minimumviableperson avatar realandrewcohn avatar maxwellbenton avatar aalexander3 avatar dick-ward avatar

Watchers

 avatar Mohawk Greene avatar Victoria Thevenot avatar Bernard Mordan avatar Otha avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar  avatar  avatar Matt avatar Antoin avatar  avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Ahmed avatar Nicole Kroese  avatar Kaeland Chatman avatar Lisa Jiang avatar Vicki Aubin avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.