Skip to content

faklyasgyuri/scramble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scramble letters exercise

Can you read the following paragraph?

"Aoccdrnig to rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe."

Let's create something similar that can scramble the words in sentences so that they remain legible.

To simplify the problem of scrambling it would not use random order, but just reverse the inner letters of the word, while keeping the first and last ones in place.

Examples

t hin g -> t nih g
w hol e -> w loh e
i mportan t -> i natropm t
p roble m -> p elbor m

How

Implementation can be done in either Java, C++ or Python. It is important to provide unit tests that prove the working solution.

More about unit tests: http://en.wikipedia.org/wiki/Unit_testing

You can choose any kind of framework that suits you the best. Please provide the necessary build script that compiles your solution and runs the tests with one command. (Makefile, a simple bash script, or whatever you know. The point is to be able to compile and run tests with a single command.)

The problem itself is not difficult. In this exercise, the emphasis is on showing the whole development cycle for a micro project. This means having tests, having a build system, and writing clean and readable code.

About

Scramble excercise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published