Skip to content

Instantly share code, notes, and snippets.

practicing code challenge and improve typescript skill [[Leetcode/Resources|Resources]]

Grind 75

Method

  • Classic Brute force: loop through number of array and then loop through again check if first value + second value = target value, return the current index and the compared index. time complexity would be: $O(n^2)$

  • One Pass: Using hash map or in this case Object in typescript. loop through the array once, calculate the difference with target - current value, if the difference already in the hash table return that hash map value which is the nums index and the current index otherwise put it inside the hash map. time complexity would be: $O(n)$

@anggakharisma
anggakharisma / .tmux.conf
Last active May 4, 2024 15:01
Tmux configuration
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'