Giter VIP home page Giter VIP logo

snowden's Introduction

Edward Snowden knows that NSA agents use the following algorithm to cypher their messages.

  1. They delete all spaces and punctuation marks.
  2. They replace all successive identical letters by one such letter.
  3. They insert two identical letters at an arbitrary place many times. Snowden has intercepted some messages which are "meaningless" sequences of letters that NSA agent Bob has sent to other NSA agent Alice about possible Snowden's location. He wants to be able to restore the message as it was after step 2). Help Snowden write snowdenDecrypt(message) JavaScript function that removes all pairs of identical letters from the message inserted at the third step. The solution should be a simple HTML page with one Textarea, one Button and one Answer area. When user clicks the Button, the message entered in Textarea should be processed by snowdenDecrypt(message) function and the result should be displayed in Answer area. The message always consists of lowercase English letters and its length is at most 100 000. Output the message after step 2). The program should produce an answer in less than a few seconds. Example
  1. Type the following message in Textarea: wwsndaadowffdennn
  2. Press Decrypt Button
  3. Decrypted message appears in Answer area: snowden

snowden's People

Contributors

bernatskyav avatar capedzillah 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.