Tag: math
You have some coins. The i-th coin has a probability prob of facing heads when tossed. Return the probability that the number of coins facing heads equals target if …
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total Hamming distance between …
BASH script programming is powerful. However, the syntax is a lot different than the other modern programming languages e.g. C/C++, Java, Python, Javascript. Practice makes perfect: through coding exercises. …
Given an array of integers A, return the largest integer that only occurs once. If no integer occurs once, return -1. Example 1: Input: Output: 8 Explanation: The maximum …
The k-digit number N is an Armstrong number if and only if the k-th power of each digit sums to N. Given a positive integer N, return true if …