Appearance
question:Write SQL code to remove duplicates from a database table. Table name: Items Columns: ID, Name
answer:DELETE FROM Items WHERE ID NOT IN (SELECT MIN(Id) FROM Items GROUP BY Name)
question:Create a Bash script which prints out the environment variable HOME.
answer:#!/bin/bash echo HOME
question:Add proper type annotations to the following Python function. def get_favorite_number(name): return name + 10
answer:def get_favorite_number(name: str) -> int: return name + 10
question:Write a shell script to find the longest string from an array of strings.
answer:#!/bin/bash arr=("Hello" "This" "Is" "A" "Sample" "String") longest={arr[0]} for element in "{arr[@]}"; do if [[ {#longest} -lt {#element} ]]; then longest="element" fi done echo longest