about | help | code help+videos | done | prefs |
Write a method hammingEncode to encode a binary message using the hamming scheme. Read 4 bits m1, m2, m3, and m4 represented as ints (1 or 0) and return the 7 bits m1, m2, m3, m4, p1, p2, p3 as a single String in that order (not the Hamming order). See https://www.cs.princeton.edu/courses/archive/spring19/cos126/assignments/hamming/ for more information or https://en.wikipedia.org/wiki/Hamming(7,4) hammingEncode(1, 1, 0, 1) → "1101100" hammingEncode(1, 0, 1, 1) → "1011010" hammingEncode(0, 0, 0, 0) → "0000000" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy