What do you want to save?
Add Code snippet
New code examples
-
Java 2022-01-29 06:41:51
nitrite get repo structure
// extracts all objects from the repository org.dizitart.no2.objects.Cursor<Employee> cursor = repository.find(); // extracts paginated employee records from the repository Cursor<Employee> cursor = repository.find(limit(0, 1)); // extracts ... Add solution -
Javascript 2022-01-27 06:01:55
javascript find nearest element
// Find the number from `arr` which is closest to `n` const closest = (arr, n) => arr.reduce((prev, curr) => Math.abs(curr - n) < Math.abs(prev - n) ? curr : prev); // Or const closest = (arr, n) => arr.sort((a, b) => Math.abs(a - n) - Mat... Add solution -
Other 2022-01-26 09:05:02
Use the linear linked list code to store a randomly generated set of 100 integers. Now write a routine that will rearrange the list in sorted order of these values.
// C program to implement Bubble Sort on singly linked list #include<stdio.h> #include<stdlib.h> /* structure for a node */ struct Node { int data; struct Node *next; }; &nbs... Add solution -
-
Javascript 2022-01-24 03:41:34
Write a shell script that takes two strings as input and determines whether two strings are the anagram.
function isAnagram(stringA, stringB) { // Sanitizing stringA = stringA.toLowerCase().replace(/[\W_]+/g, ""); stringB = stringB.toLowerCase().replace(/[\W_]+/g, ""); // sorting const stringASorted = stringA.split(""... Add solution
Best helpers
Ranking is empty