GithubHelp home page GithubHelp logo

audible's Introduction

Introduction=================================================

This project contains the solution to Audible code test

Requirement==================================================

Given a โ€œn x mโ€ array (n & m could be different or same numbers), print the contents of the array in a spiral order (i.e. print the outermost elements followed by the next inner layer followed by the next inner layer and so on until all elements are printed) in a clockwise manner. Note that all elements of the array should be printed only once. The input could be either read from a text file or from a command prompt and the output should be printed on a console.

Example 1:

Array contents:
A b c d e 1
F g h i j 2
K l m n o 3
P q r s t 4

Output: a b c d e 1 2 3 4 t s r q p k f g h i j o n m l

Example 2:

Array contents:
1 2 3 4
5 6 7 8
9 10 11 12

Output: 1 2 3 4 8 12 11 10 9 5 6 7

How to run the program=======================================

  1. With file input Save input in text file with name specified. After compiled java code, run "java audible.ArrayPrinter file.name".

  2. With Console input After compiled java code, run "java audible.ArrayPrinter", and then input each line in the console. Press "enter" key twice signals the end of input.

audible's People

Contributors

franzjain 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.