6 kyu

Data Reverse

1,306 of 25,129sataman

Description:

A stream of data is received and needs to be reversed.

Each segment is 8 bits long, meaning the order of these segments needs to be reversed, for example:

11111111  00000000  00001111  10101010
 (byte1)   (byte2)   (byte3)   (byte4)

should become:

10101010  00001111  00000000  11111111
 (byte4)   (byte3)   (byte2)   (byte1)

The total number of bits will always be a multiple of 8.

The data is given in an array as such:

[1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,0,1,0,1,0]

Note: In the C and NASM languages you are given the third parameter which is the number of segment blocks.

Arrays
Fundamentals

Similar Kata:

More By Author:

Check out these other kata created by sataman

Stats:

CreatedJan 18, 2016
PublishedJan 19, 2016
Warriors Trained44688
Total Skips8380
Total Code Submissions80978
Total Times Completed25129
C# Completions1306
Python Completions7782
Java Completions2550
Haskell Completions342
Ruby Completions659
JavaScript Completions12237
NASM Completions33
C Completions547
COBOL Completions5
Total Stars523
% of votes with a positive feedback rating92% of 2471
Total "Very Satisfied" Votes2132
Total "Somewhat Satisfied" Votes307
Total "Not Satisfied" Votes32
Total Rank Assessments40
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • sataman Avatar
  • Unnamed Avatar
  • suic Avatar
  • anter69 Avatar
  • SquishyStrawberry Avatar
  • Nancy27 Avatar
  • Nicole20 Avatar
  • Chrono79 Avatar
  • JohanWiltink Avatar
  • Demki Avatar
  • Blind4Basics Avatar
  • FArekkusu Avatar
  • Victor_deAndres Avatar
  • hobovsky Avatar
  • uniapi Avatar
  • trashy_incel Avatar
  • akar-0 Avatar
Ad