# Archives

# Algorithm for counting number of decks in a given pack of cards

this.decksOfCards([“2S”, “2C”, “2D”, “2H”, “3S”, “3C”, “3D”, “3H”, “4S”, “4C”, “4D”, “4H”, “5S”, “5C”, “5D”, “5H”, “6S”, “6C”, “6D”, “6H”, “7S”, “7C”, “7D”, “7H”, “8S”, “8C”, “8D”, “8H”, “9S”, “9C”, “9D”, “9H”, “TS”, “TC”, “TD”, “TH”, “JS”, “JC”, “JD”, “JH”, “QS”, “QC”, “QD”, “QH”, “KS”, “KC”, “KD”, “KH”, “AS”, “AC”, “AD”, “AH”, “2S”, “2C”, “2D”, […]

# single lane highway

The problem statement isn’t clear. In the given example, 11 groups are cited but the count is only 10. Also, explain in detail what do you mean by groups and how are they formed for this problem statement to be able for us to solve this problem for you.

# What is the best algorithm for multiplying very large numeric strings (50k or more digits)?

Try executing the above code on http://code.golibrary.co:8000

# What is the best algorithm for multiplying very large numeric strings ?

Fast multiplication of very large numeric strings can be easily achieved in O(n log n) time complexity using FFT multiplication. Below is a python code which illustrates this for multiplication of strings with 1,60,000 digits. The algorithm is fast enough for even bigger strings than this.

# Write a function to decode an octal string to a number in an array of bytes

Refer a full solution here: https://github.com/idotrick/practice-java/tree/master/src/main/java/util/encode

# What’s the minimum number of weights required to count between 1 to 121 pounds ?

This type of problems have a standard formula to compute the minimum number of weights and it’s given by Ceiling of the log to the base 2 of the maximum weight to be counted. Thus, the formula would be where W is the max weight which is 121 pounds in this case which would give […]