---
# System prepended metadata

title: Untitled

---

## Task: Palindrome

Write a function that finds the smallest palindrome number greater than N for which its square value is also palindrome.

121
1221

    

``` python
def check_if_palindrome(input_number):
    input_as_string = str(input_number)
    input_as_string_to_compare = input_as_string
    input_as_string_to_compare = input_as_string_to_copmare [::-1]
    if input_as_string == input_as_string_to_compare:
        return True
    else
        return False

def get_grater_palindrome(input_number):
    palindrome_1 = 0
    palindrome_final_result = 0
    found = 'N'
    while found == 'N':
        if check_if_palindrome(input_number):
            if check_if_palindrome(sqrt(input_number)):
                palindrome_final_result = palindrome_1
                found = 'Y'
        palindrome_1 = palindrome_1 + 1
    return palindrome_final_result
```



## Task: task scheduler

You have N tasks to run in any order you want.
Each task takes one time step to run.
There must be a minimum of K (cooldown value) time steps between two runs of the same task.
Write a function that returns the sequence of tasks to run in a minimal amount of time steps.

Examples:
1) tasks = ["A", "A", "B"], K = 3
["A", "B", "", "", "A"]
2) tasks = ["A","A","A","B","B","B"], K = 2
["A", "B", "", "A", "B", "", "A", "B"]
3) tasks = ["A", "B", "B", "C"], K = 4
["B", "A", "C", "", "", "B"]


counter.most_common()

``` python
from collections import Counter

def task_scheduler(tasks, k):
    task_mapping = Counter(tasks)
    task_mapping.most_common()
    list_of_scduled_elements = []
    # REMOVE FROM DICTIONARY AFTER PUTTING INTO TASK LIST
    # checking if list has > K
        # check if I have task B
            # put it into list
    
    
['A', 'A', 'B', 'B', 'B', 'C'] K = 3


B, A, C, '', B


```