Skip to content

Conversation

@tanishq98
Copy link

I have added the most optimized code to find N prime Number by taking care of both Time and Space Complexities.
Time Complexity of this code is almost half of the other codes of prime number found online.
This code can be used in interviews and competitive programming for better performance of your Solution.

I have added the most optimized code to find N prime Number by taking care of both Time and Space Complexities. 
Time Complexity of this code is almost half of the other codes of prime number found online. 
This code can be used in interviews and competitive programming for better performance of your Solution.
You are given a number n1, representing the size of array a1.
You are given n1 numbers, representing elements of array a1.
You are given a number n2, representing the size of array a2.
You are given n2 numbers, representing elements of array a2.
The two arrays represent digits of two numbers.
You are required to add the numbers represented by two arrays and print the
arrays
Solution: I have attached the optimized and advanced code for this problem. 
Pro-tip: If both the arrays have same number of elements then it is very easy to sum those arrays. But, what if number of elements are different ??
Refer this solution to hack this problem.
Sum of 2 Arrays- Best Solution for SDE Interviews and CP
We all know converting a decimal or binary to other type is a very small and less pained task. But, Irony most of the Engineers and aspiring Developers don't know a single conversion on this. 
This is best, optimized and easy way to convert base from to any other (Octa, binary, etc.) in Java. 
Do comment if you develop a more optimized way than this. Because inheriting knowledge from one another make you a Successful person in your life.
Decimal to Any Base- Most Asked interview Ques for SDE's
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant