What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-01 04:21:03
anagram js
function isAnagram(stringA, stringB) { // Sanitizing stringA = stringA.toLowerCase().replace(/[\W_]+/g, ""); stringB = stringB.toLowerCase().replace(/[\W_]+/g, ""); // sorting const stringASorted = stringA.split(""... Add solution -
C++ 2021-08-31 16:35:03
how to arrange array in ascending order in c++\
#include <iostream> using namespace std; #define MAX 100 int main() { //array declaration int arr[MAX]; int n,i,j; int temp; //read total number of elements to read cout<<"Enter total number of elements to read: "; cin>... Add solution -
Python 2021-08-31 09:02:01
merge all mp4 video files into one file python
from moviepy.editor import * import os from natsort import natsorted L =[] for root, dirs, files in os.walk("/path/to/the/files"): #files.sort() files = natsorted(files) for file in files: if os.path.splitext(file)[1] == '... Add solution -
Python 2021-08-31 08:20:02
python reverse dict key order
>>> a = {0:'000000',1:'11111',3:'333333',4:'444444'} >>> a.keys() [0, 1, 3, 4] >>> sorted(a.keys()) [0, 1, 3, 4] >>> reversed(sorted(a.keys())) <listreverseiterator object at 0x02B0DB70> >>> list(reversed... Add solution -
Shell/Bash 2021-08-30 09:50:03
bash sort bed file by chrom start end
# Basic syntax: sort -V -k1,1 -k2,2 input_file.bed > sorted_file.bed # This sorts alphanumerically by chromosome and then byvstart position # and then by end position, producing a file order like: chr1 1 10 chr1 2 5 chr2 1 10 . . . . . . . . . chr1... Add solution -
Other 2021-08-30 05:45:01
maximum element in a window of size k
#include <bits/stdc++.h> using namespace std; // A Dequeue (Double ended queue) based method for printing maximum element of // all subarrays of size k void printKMax(int arr[], int n, int k) { // Create a Double Ended Queue, Qi that will s... Add solution -
Shell/Bash 2021-08-29 22:14:03
bash only print duplicated lines
# Basic syntax: sort input_file | uniq -d # Sort the file first because uniq requires a sorted file to work # Note, uniq -d only prints one instance of lines that have duplicates # Use, uniq -c to count the number of duplicates in the file Add solution