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

 

calculateSignalPower


Problem: Signal Diagnostics

Problem Description: An underwater drone is monitoring the environment using a series of binary readings, representing signal strength at different time intervals. These readings need to be analyzed to determine the dominant signal pattern (similar to the gamma rate) and the minor signal pattern (similar to the epsilon rate).

To do this: For each bit position, determine the most common bit across all readings to form the dominant signal pattern.
For each bit position, determine the least common bit to form the minor signal pattern.

101
110
111
010
011

The signal power is then calculated as the product of the decimal values of the dominant and minor signal patterns.


calculateSignalPower(["101", "110", "111", "010", "011"]) → 0
calculateSignalPower(["100", "010", "110", "111", "011", "101"]) → 6
calculateSignalPower(["110", "111", "011", "001", "100", "101", "010"]) → 0

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

public int calculateSignalPower(String[] binaries) { }

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

Copyright Nick Parlante 2017 - privacy