GithubHelp home page GithubHelp logo

codility1's Introduction

Instructions

  1. Create a repository on your GitHub account.

  2. Write down the solution in a file

  3. Push the solution to the above repository once done.

  4. Submit the repository link for review.

  5. Ensure your repository has a well-written README, detailing the steps taken to break down the problem and come up with a solution (Read me Sample.)

Challenge 1: No ifs no buts(Toy Problem) Write a function that accepts two numbers a and b and returns whether a is smaller than, bigger than, or equal to b, as a string.

Example:

(5, 4) ---> "5 is greater than 4"

(-4, -7) ---> "-4 is greater than -7"

(2, 2) ---> "2 is equal to 2" There is only one problem...

You cannot use if statements, and you cannot use the ternary operator ?

In fact, the word if and the character ? are not allowed in your code.

Challenge2: Ordered Count of Characters(Toy Problem) Count the number of occurrences of each character and return it as a (list of arrays) in order of appearance. For empty output return (an empty list).

Example:

"abracadabra" ----> [['a', 5], ['b', 2], ['r', 2], ['c', 1], ['d', 1]]

"Code Wars -----> [['C', 1], ['o', 1], ['d', 1], ['e', 1], [' ', 1], ['W', 1], ['a', 1], ['r', 1], ['s', 1]]

"233312", ------> [['2', 2], ['3', 3], ['1', 1 ]]

codility1's People

Stargazers

jacinta mwangi avatar

Watchers

jacinta mwangi 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.