Files
interview/exercises.py
2023-08-03 17:04:23 -07:00

46 lines
875 B
Python

import re
import pandas as pd
def lc(l1: list):
"""For input list l1 of integers, return list of elements
whose square is less than sum of all elements"""
return None
def nlc(l1: list, l2: list):
"""For input lists l1, l2, return a list of elements common
to both l1 and l2."""
return None
def dc(l1: list):
"""For input list l1 of integers, return a dictionary with
keys from l1, and values are squares of keys"""
return None
if __name__ == "__main__":
l1 = [1, 2, 3, 4]
l2 = [2, 4, 6, 8]
print("Inputs:")
print(f"l1: {l1}")
print(f"l2: {l2}")
print("\n-------------------\n")
print("lc:")
print(lc(l2))
print("\n-------------------\n")
print("nlc:")
print(nlc(l1, l2))
print("\n-------------------\n")
print("dc:")
print(dc(l1))
print("\n-------------------\n")