Code Monkey home page Code Monkey logo

codemama's Introduction

Codemama Problem Solving

Problem 1

Write a program to create a function that determines whether elements in an array can be re-arranged to form a consecutive list of numbers where each number appears exactly once. The difference between two numbers will be 1 always.

Input The program will take an integer N as the size of an array. Then it will take the integer values of the array M[].

5
4 2 3 1 0

Output

true

Input

6
1 2 3 4 4 5

Output

false

Notes: If there are any duplicates, it's impossible to form a consecutive list

Solution

test-1.js

Problem 2

Write a program to create a function that determines whether a string is a valid code. A code must begin with a pound key # and is exactly 6 characters in length. Each character must be a digit from 0-9 or an alphabetic character from A-F. All alphabetic characters may be uppercase or lowercase.

Input The program will take a string #CD5C5C as input.

Output The output will print either true or false

Solution

test-2.js

codemama's People

Contributors

autocircled avatar

Watchers

 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.