goli202084 | Reputations

goli202084 1.93K Rep.
Posted an answer
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...

September 6, 2020 5
Posted an answer
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...

May 10, 2020 5
Commented on a post

Can you post complete solution here with explanation, instead of just a link, as it will help our readers ?

May 10, 2020 2
Given an up vote
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

May 10, 2020 2
Posted an answer
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...

April 30, 2020 5
Posted an answer
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...

April 30, 2020 5
Posted an answer
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...

April 1, 2020 5
Asked a question
How to find the area of gray portion in the image ?

How to find area of gray portion in the image ?

April 1, 2020 2
Asked a question
Count subarrays with element product less than target

Your are given an array of positive integers numbers. Count and print the number of (contiguous) sub-arrays where the product of all the elements in the sub-array is less than k. Example 1: Input:...

April 1, 2020 2
Posted an answer
Print all triplets with sum less than target in an array

Same algorithm implemented in C++ [apcode language="cpp"] using namespace std;  #include <algorithm> #include <iostream> #include <string> #include <vector>  class TripletWithSmallerSum...

April 1, 2020 5
Posted an answer
Print all triplets with sum less than target in an array

Below is the Javascript code for the above problem. Please follow this blog (https://www.golibrary.co/count-all-triplets-with-sum-less-than-target-in-a-given-array/) for detailed explanation on how the...

April 1, 2020 5
Asked a question
Can you guess the programming languages in the attached image ?

Guess the programming languages in the image above ?

March 22, 2020 2
Posted an answer
Search an element in sorted rotated array

Even though the array is rotated, we can still use binary search here by finding the point of rotation using the function findPivotIndex() as shown below. Once we find the pivot (point of rotation), divide...

March 9, 2020 5
Posted an answer
How to implement an algorithm to find letter combinations of a phone number ?

Below is a Javascript Solution to this problem using Depth first search traversal !! [apcode language="jscript"] /**  * @param {string} digits  * @return {string[]}  */ var letterCombinations =...

March 8, 2020 5
Posted an answer
How to find height or maximum depth of binary of binary tree ?

Diameter of binary tree You might also be interested in reading this as the above problem is a subset of this:- https://www.golibrary.co/finding-diameter-of-a-binary-tree/

March 4, 2020 5
Given an up vote
How to find diameter of a binary tree ?

Please visit this blog for a detailed explanation of this algorithm:- Diameter of Binary Tree

March 1, 2020 2
Given an up vote
How to find diameter of a binary tree ?

Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may...

March 1, 2020 2
Asked a question
How to dump given database in full in mysql from command prompt ?
February 25, 2020 2
Asked a question
How to free up a port on windows ?

How to get rid of error  listen EADDRINUSE: address already in use 127.0.0.1: on windows

February 25, 2020 2
Asked a question
Given a string s, convert it into a palindrome

Given a string s, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation. Example 1:...

February 24, 2020 2
Load More