What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2021-09-08 22:45:02
write a program to print all unique elements in an array
//write a program to print all unique elements in an array in c #include <stdio.h> int main(int argc, char const *argv[]) { int arr[] = {4, 256, 2, 256, 4, 3, 3, 5}, seen; int arr_length = sizeof(arr) / sizeof(int); for (int i = 0; i ... Add solution -
Python 2021-09-01 00:49:01
simple mastermind programpython
import random import os def clear(): os.system("clear") # Function to print the mastermind board def print_mastermind_board(passcode, guess_codes, guess_flags): print(&q... Add solution -
Shell/Bash 2021-08-31 09:45:01
bash count the number of lines that meet condition
# Basic syntax: awk 'condition { count_variable++ } END { print count_variable }' input_file # Where: # - ++ increases the count by 1 when the condition is true # - END specifies what to do after the input_file has been processed # Example usage: awk '$3... Add solution -
Shell/Bash 2021-08-28 21:22:01
bash print line if column value is in column of another file
# Example usage: awk 'FNR==NR{a[$1]=$1; next}; $8 in a {print $0;}' input_file_1 input_file_2 # This command prints rows from input_file_2 if the value in a specific # field of input_file_2 is found in a specific column of input_file_1. # With these speci... Add solution