Snippets Collections
let words = input.match(/(\w+)/g).length
  
// Efficient Method : Time Complexity : O(n), Auxiliary space : O(1)

import java.util.*;
import java.io.*;

class GFG 
{ 
    static int maxConsecutiveOnes(int arr[], int n)
    {
    	int res = 0, curr = 0;

    	for(int i = 0; i < n; i++)
    	{
    		if(arr[i] == 0)
    			curr = 0;
    		else
    		{
    			curr++;

    			res = Math.max(res, curr);
    		}
    	}
    	
    	return res;
    }

    public static void main(String args[]) 
    { 
       int arr[] = {0, 1, 1, 0, 1, 1, 1}, n = 7;

       System.out.println(maxConsecutiveOnes(arr, n)); // Output : 3
    } 
}


// Naive Method : Time Complexity : O(n^2), Auxiliary space : O(1)

    static int maxConsecutiveOnes(int arr[], int n)
    {
    	int res = 0;

    	for(int i = 0; i < n; i++)
    	{
    		int curr = 0;

    		for(int j = i; j < n; j++)
    		{
    			if(arr[j] == 1) curr++;
    			else break;
    		}

    		res = Math.max(res, curr);
    	}
    	
    	return res;
    }
var secondsRemaining = 60    
Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { (Timer) in
        if secondsRemaining > 0 {
            print ("\(self.secondsRemaining) seconds")
            secondsRemaining -= 1
        } else {
            Timer.invalidate()
        }
    }
trx_1.select(f.countDistinct("stg_nexus_member_cd")).show()
for file in *
do
file=${file//.bam/}
samtools sort -@ 14 $file.bam > $file.sorted.bam
samtools index -@ 14 -b $file.sorted.bam
samtools idxstats -@ 14 $file.sorted.bam > $file.idxstats.txt
done
star

Wed Apr 05 2023 15:59:39 GMT+0000 (Coordinated Universal Time) https://codetogo.io/

#javascript #counter #count
star

Mon Aug 08 2022 11:13:04 GMT+0000 (Coordinated Universal Time)

#javascript #string #word #count
star

Tue Feb 01 2022 07:12:29 GMT+0000 (Coordinated Universal Time)

#ios #swift #timer #counter #count #countdown
star

Wed May 26 2021 08:31:02 GMT+0000 (Coordinated Universal Time)

#pyspark #unique #count #dataframe #column
star

Sun Mar 28 2021 12:49:54 GMT+0000 (Coordinated Universal Time) https://www.notion.so/rezaeir/Code-Snippets-f347e2e7bc2d4217854f17cb0a5e0746

#bash #samtools #bam #count

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension