id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

orion.a.smith@gmail.com apcsa-encryption > apcsaDecryptRailFence
prev  |  next  |  chance

Given an ciphertext String and a number of rails, decode it using a rail fence cipher and return the plaintext. The rail fence cipher is described here:


https://en.wikipedia.org/wiki/Rail_fence_cipher

Precondition: at least two rails.
HINT
You will need to think two-dimensionally again. (I think) this is harder than the encode.

apcsaDecryptRailFence("WECRERDSOEEAIVD", 3) → "WEAREDISCOVERED"
apcsaDecryptRailFence("hhiiesepepmenrpesdllbgre", 3) → "helphelpimbeingrepressed"
apcsaDecryptRailFence("0817926354", 5) → "0123456789"

...Save, Compile, Run (ctrl-enter)

public String apcsaDecryptRailFence(String cipherText, int numRails) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 330

Copyright Nick Parlante 2017 - privacy