Category: java
The Catalan number as described here is one of the well-known combinatorial number that has quite a few applications. For example, C(n) can be used to count the number …
Given an array A of 0s and 1s, consider N_i: the i-th subarray from A to A interpreted as a binary number (from most-significant-bit to least-significant-bit.) Return a list …
Have you ever needed a quick tool to lookup multiple hosts (Java based on the InetAddress class. The following Java code has been uploaded to github: https://github.com/DoctorLai/DNSLookup import java.net.InetAddress; …
We are given two sentences A and B. (A sentence is a string of space separated words. Each word consists only of lowercase letters.) A word is uncommon if …
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. The given integer is guaranteed to fit within the …