Giter Site home page Giter Site logo

sainsburysgopherconukchallenge2018's Introduction

Sainsbury's GopherCon UK Challenge 2018

One of our delivery riders has been given some very confusing instructions. On a (seemingly endless) grid of houses, he has to deliver to each house he arrives at.

His instructions are given as a string consisting of one of four characters:

  • ^ to move north one square
  • > to move east one square
  • v to move south one square
  • < to move west one square

To the bemusement of the rider, this means some houses has more than one delivery

The challenge

Complete calculateHouses(input string) int function to work out how many unique houses the rider visits.

This also includes the house he starts at.

Completion

The challenge is complete when all the unit tests pass run with ginkgo (github.com/onsi/ginkgo/ginkgo) or go test.

Examples

If our rider is given '>>', he visit 3 houses:

  • The house he starts at, before moving east
  • The next house,before moving east again
  • The final house

If our rider is given '^>v<', he visit 4 houses:

  • The house he starts at, before moving north
  • The next house, before moving east
  • The next house, before moving south
  • The next house, before moving west
  • This brings him back to the house he started at, where he has already made a delivery

sainsburysgopherconukchallenge2018's People

Stargazers

 avatar

Watchers

 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.