# Citadel

[longest\_non\_decreasing\_subarray](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/dp/longest_non_decreasing_subarray "mention")

[number\_of\_good\_binary\_strings](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/dp/number_of_good_binary_strings "mention")

[minimum\_knight\_moves](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/bfs/minimum_knight_moves "mention")

[delete\_and\_earn](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/dp/delete_and_earn "mention")

[maximum\_path\_sum](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/binary_tree/maximum_path_sum "mention")

[lfu\_cache](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/design/lfu_cache "mention")

[lru\_cache](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/design/lru_cache "mention")

[knight\_probability\_in\_board](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/bfs/knight_probability_in_board "mention")

[robot\_room\_cleaner](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/dfs/robot_room_cleaner "mention")

[minimum\_height\_tree](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/bfs/minimum_height_tree "mention")

[evaluate\_reverse\_polish\_notation](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/stack/evaluate_reverse_polish_notation "mention")

[get\_random](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/design/get_random "mention")

[validate\_bst](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/binary_search_tree/validate_bst "mention")

[find\_duplicate\_num](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/array/find_duplicate_num "mention")

[permutations](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/backtracking/permutations "mention")

[buy\_and\_sell\_stock](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/dp/buy_and_sell_stock "mention")

[house\_robber](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/dp/house_robber "mention")

[subarray\_sum\_k](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/prefix_sum/subarray_sum_k "mention")

[n\_queens](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/backtracking/n_queens "mention")

[range\_addition](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/prefix_sum/range_addition "mention")

[minimum\_costs\_using\_train\_line](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/dp/minimum_costs_using_train_line "mention")

[smallest\_range\_ii](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/algorithm/greedy/smallest_range_ii "mention")

[fibonacci](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/company-tags/citadel/fibonacci "mention")

[pi](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/company-tags/citadel/pi "mention")

[probability](https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/company-tags/citadel/probability "mention")

## Python

```python
nums = [1,2,3]
nums.append(1)
nums.pop()
nums.sort()

# Dictionary
dict = {'a':1,'b':2,'c':3}
dict.keys() # returns list of keys of dictionary
dict.values() # returns list of values of dictionary

dict.get('a') # returns value for any corresponding key
dict.items() # returns [('a',1),('b',2),('c',3)]
dict.pop(KEY) # pops key-value pair with that key

# A double-ended queue, or deque, has the feature of adding and removing elements from either end.
from collections import deque

queue = deque(['name','age','DOB'])

queue.append("append_from_right") # Append from right
queue.pop() # Pop from right

queue.appendleft("fromLeft") # Append from left
queue.popleft() # Pop from left

# min heap
nums = [5, 7, 9, 1, 3]
heapq.heapify(nums) # converts list into heap. Can be converted back to list by list(nums).
heapq.heappush(nums,element) # Push an element into the heap
heapq.heappop(nums)

# max heap
nums = [5, 7, 9, 1, 3]
nums = [-num for num in nums]  # Negate all elements
heapq.heapify(nums)  #
largest_element = -heapq.heappop(nums)


text = 'Python is a fun programming language'

# split the text from space
print(text.split(' '))
name = "M3onica Gell22er "
print(name.isalnum()) # Output : False
#The isalpha() method returns True if all characters in the string are alphabets. If not, it returns False
name = "Monica"
print(name.isalpha()) #output true

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dongzeli95s-organization.gitbook.io/swe-interview-handbook/company-tags/citadel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
