Skip to content

Instantly share code, notes, and snippets.

@anggakharisma
anggakharisma / .tmux.conf
Last active March 23, 2024 18:15
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'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'

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)$