"check the count of both sentences if the same then start loop on words count and check the presence of words are the same."
Suleman A. - "check the count of both sentences if the same then start loop on words count and check the presence of words are the same."See full answer
"SQL databases are relational, NoSQL databases are non-relational. SQL databases use structured query language and have a predefined schema. NoSQL databases have dynamic schemas for unstructured data. SQL databases are vertically scalable, while NoSQL databases are horizontally scalable."
Ali H. - "SQL databases are relational, NoSQL databases are non-relational. SQL databases use structured query language and have a predefined schema. NoSQL databases have dynamic schemas for unstructured data. SQL databases are vertically scalable, while NoSQL databases are horizontally scalable."See full answer
"function knapsack(weights, values, cap) {
const indicesByValue = Object.keys(weights).map(weight => parseInt(weight));
indicesByValue.sort((a, b) => values[b]-values[a]);
const steps = new Map();
function knapsackStep(cap, sack) {
if (steps.has(sack)) {
return steps.get(sack);
}
let maxOutput = 0;
for (let index of indicesByValue) {
if (!sack.has(index) && weights[index] <= cap) {
maxOutput ="
Tiago R. - "function knapsack(weights, values, cap) {
const indicesByValue = Object.keys(weights).map(weight => parseInt(weight));
indicesByValue.sort((a, b) => values[b]-values[a]);
const steps = new Map();
function knapsackStep(cap, sack) {
if (steps.has(sack)) {
return steps.get(sack);
}
let maxOutput = 0;
for (let index of indicesByValue) {
if (!sack.has(index) && weights[index] <= cap) {
maxOutput ="See full answer
"Use a mapping to store number characters to possible meaning, iterate through the numeronym matching all digits with their representation"
Anonymous Bobcat - "Use a mapping to store number characters to possible meaning, iterate through the numeronym matching all digits with their representation"See full answer
Software Engineer
Technical
🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.
"A full stack developer could be summarized as the person who both writes the APIs and consumes the APIs. They are familiar with Databases/Data-layer services, middle-layer/application services and business logic, and finally familiar with the consumers whether front-end applications/UIs or other systems. They can understand the trade-offs up and down the stack, where to adjust along the service-call-path. Ideally they are comfortable programming both async calls (front end javascript promises, e"
Luke P. - "A full stack developer could be summarized as the person who both writes the APIs and consumes the APIs. They are familiar with Databases/Data-layer services, middle-layer/application services and business logic, and finally familiar with the consumers whether front-end applications/UIs or other systems. They can understand the trade-offs up and down the stack, where to adjust along the service-call-path. Ideally they are comfortable programming both async calls (front end javascript promises, e"See full answer
"The first part is to design with either a linked list of IDs or an array of boolean values. The second part is to optimize both time and memory."
Seamus L. - "The first part is to design with either a linked list of IDs or an array of boolean values. The second part is to optimize both time and memory."See full answer
"
read_dir(path: str) -> list[str] returns the full path of all files and sub- directories of a given directory.
is_file(path: str) -> bool: returns true if the path points to a regular file.
is_dir(path: str) -> bool: returns true if the path points to a directory.
read_file(path: str) -> str: reads and returns the content of the file.
The algorithm: notice that storing all the file contents' is too space intensive, so we can't read all the files' contents to store and compare with each"
Idan R. - "
read_dir(path: str) -> list[str] returns the full path of all files and sub- directories of a given directory.
is_file(path: str) -> bool: returns true if the path points to a regular file.
is_dir(path: str) -> bool: returns true if the path points to a directory.
read_file(path: str) -> str: reads and returns the content of the file.
The algorithm: notice that storing all the file contents' is too space intensive, so we can't read all the files' contents to store and compare with each"See full answer
"Go has simpler syntax than Java. It is light weight. It is not Object Oriented. It does not support function overloading and function overriding. But these are small technical differences. Both are similar when it comes to testing. You have to create a mock object and implement an interface. Functionally, I did not feel any major difference."
Vishal T. - "Go has simpler syntax than Java. It is light weight. It is not Object Oriented. It does not support function overloading and function overriding. But these are small technical differences. Both are similar when it comes to testing. You have to create a mock object and implement an interface. Functionally, I did not feel any major difference."See full answer
"
The productofarrays() function works by first creating an empty array to store the product of the two integers. Then, it iterates through the first array and multiplies each element by each element in the second array. The product of each element is then appended to the product array. Finally, the product array is returned
def productofarrays(array1, array2):
"""
Calculates the product of two integers represented by two arrays.
Args:
array1: The first array.
array2: The se"
Praful B. - "
The productofarrays() function works by first creating an empty array to store the product of the two integers. Then, it iterates through the first array and multiplies each element by each element in the second array. The product of each element is then appended to the product array. Finally, the product array is returned
def productofarrays(array1, array2):
"""
Calculates the product of two integers represented by two arrays.
Args:
array1: The first array.
array2: The se"See full answer
"I try to solve this initially using quick select where will take a pivot element and position the remaining elements and check if the current index is answer or not and continue the same but it requires o(n*n), but interviewee is expecting the best from me, so at the end i tried solving using heaps where will check the difference between k and n-k to use min or max heap after that we will heap the array, and will keep popping the element k-1 and return the peek one which leads to answer."
Mourya C. - "I try to solve this initially using quick select where will take a pivot element and position the remaining elements and check if the current index is answer or not and continue the same but it requires o(n*n), but interviewee is expecting the best from me, so at the end i tried solving using heaps where will check the difference between k and n-k to use min or max heap after that we will heap the array, and will keep popping the element k-1 and return the peek one which leads to answer."See full answer
"let str = 'this is a test of programs';
let obj={};
for (let s of str )
obj[s]?(obj[s]=obj[s]+1):(obj[s]=1)
console.log(JSON.stringify(obj))"
Anonymous Emu - "let str = 'this is a test of programs';
let obj={};
for (let s of str )
obj[s]?(obj[s]=obj[s]+1):(obj[s]=1)
console.log(JSON.stringify(obj))"See full answer
"CIDR (Classless Inter-Domain Routing) -- also known as supernetting -- is a method of assigning Internet Protocol (IP) addresses that improves the efficiency of address distribution and replaces the previous system based on Class A, Class B and Class C networks."
Ali H. - "CIDR (Classless Inter-Domain Routing) -- also known as supernetting -- is a method of assigning Internet Protocol (IP) addresses that improves the efficiency of address distribution and replaces the previous system based on Class A, Class B and Class C networks."See full answer