Given a list of filenames (with extensions), one per line, count the number of files for each extension. Output format: count .ext, sorted by descending count, then by descending extension for ties.
hello.txt
bye.pdf
cats.txt
video.mp4
music.mp3
document.docx
list.txt
song.mp3
movie.MP4
3 .txt
2 .mp4
2 .mp3
1 .pdf
1 .docx
Given a list of filenames (with extensions), one per line, count the number of files for each extension. Output format: count .ext, sorted by descending count, then by descending extension for ties. ## Instructions - Write your script in script.sh. - Read from standard input, write to standard output. - Extensions are case-insensitive; output in lowercase. - Count column is right-aligned to 2 characters. ## Sample Input ```text hello.txt bye.pdf cats.txt video.mp4 music.mp3 document.docx list.txt song.mp3 movie.MP4 ``` ## Sample Output ```text 3 .txt 2 .mp4 2 .mp3 1 .pdf 1 .docx ``` ## Constraints - Filenames always contain an extension. - Extensions may be in any case; output must be lowercase. - Output must be in lowercase. Given n, find all twin-prime pairs whose sum is <= n. Print each pair as (p1, p2), sorted ascending by the first prime. ## Instructions - Write your script in script.sh. - Read n from standard input. ## Sample Input ```text 24 ``` ## Sample Output ```text (3, 5) (5, 7) (11, 13) ``` ## Constraints - n is a positive integer <= 10000. Given a string, check if its SHA-1 hash contains the string. If not, hash the hash and check again. Repeat up to 10 times. Print the iteration number and hash for each step. Stop when found; print Not Found after 10 iterations if never found. If the input contains non-hex characters, immediately print Not Found (it can never appear in a SHA-1 hash). ## Instructions - Write your script in script.sh. - Read one line from standard input. - Check is case-insensitive. ## Sample Input 1 ```text g ``` ## Sample Output 1 ```text Not Found ``` ## Sample Input 2 ```text 12 ``` ## Sample Output 2 ```text 1: ad552e6dc057d1d825bf49df79d6b98eba846ebe 2: ab16bf05b01c833603826780711e0012597f02d7 ``` ## Constraints - Input contains only printable alphanumeric characters.