# 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 […]

# Is NodeJS multi-threaded ? How does NodeJS handle multiple requests ?

Main question:- Is NodeJS multi-threaded ?     Answer is :- Yes & No     Yes, because NodeJS internally manages a limited thread pool which handles multiple client requests based on which thread is avaiable in the pool to process the request.     No, because programmers cannot create threads on the fly to […]

14 + 20

# How to find the area of gray portion in the image ?

To find the area of gray portion, we  use the below equation Area of gray portion = Area of the semicircle on the Left hand side – Area of semicircle with diameter 2.6 cm + Area of semicircle with diameter 1.8 cm => 0.5 * π[0.5*(2.6+1.8)]^2 – 0.5*π(1.3)^2 + 0.5*π(0.9)^2 => 6.22035345411 sq cms Hope that […]

# Count subarrays with element product less than target

Simple Java code:- Javascript option