---
# System prepended metadata

title: 'Hello Łukasz :)'

---

# Hello Łukasz :) 

## Task 1 - Remove even integers from a list

### Problem
Implement a function that removes all the even elements from a given list. Name it `remove_even(lst)`.

### Sample Input
```
my_list = [1,2,4,5,10,6,3]
```
### Sample Output
```
my_list = [1,5,3]
```

### Your Code
```
def remove_even(lst):
    return [x for x in lst if x % 2 == 1]
```          


## Task 2 - List of Products of all Elements


### Problem
Write a small function, `find_product(lst)`, which modifies a list so that each index has a product of all the numbers present in the list except the number stored at that index.

### Sample Input
```
arr = [1,2,3,4]
```
### Sample Output
```
arr = [24,12,8,6]
```



### Your Code
```
def find_product(lst):
    product = 1
    for x in lst:
        product *= x
    return [product // lst[i] for i in range(len(lst))]
```   
    
## Task 3 - House Thief


### Problem
Given a number array representing the wealth of 'n' houses, determine the maximum amount of money the thief can steal without alerting the security system. Theif cannot steal from two consecutive houses.

### Example 1 
```
Input: {2, 5, 1, 3, 6, 2, 4}
Output: 15
Explanation: The thief should steal from houses 5 + 6 + 4
```
### Example 2
```
Input: {2, 10, 14, 8, 1}
Output: 18
Explanation: The thief should steal from houses 10 + 8
```



### Your Code
```
def do_find_max_steal(wealth, current_house, robbed = 0):
  if current_house >= len(wealth):
    return robbed
  return max(
    do_find_max_steal(wealth, current_house + 2, robbed + wealth[current_house]),
    do_find_max_steal(wealth, current_house + 3, robbed + wealth[current_house])
  )
  

def find_max_steal(wealth):
  return max(
    do_find_max_steal(wealth, 0),
    do_find_max_steal(wealth, 1)
  )


def main():

  # print(find_max_steal([2, 5, 1, 3, 6, 2, 4]))
  print(find_max_steal([2, 10, 14, 8, 1]))


main()

```
