- python
sharo@kirima:~$ python
Command 'python' not found, did you mean:
command 'python3' from deb python3
command 'python' from deb python-is-python3
| class Solution: | |
| def minCostClimbingStairs(self, costs: List[int]) -> int: | |
| n = len(costs) | |
| if n == 2: | |
| return min(costs[0], costs[1]) | |
| dp = [0] * n |
| class Solution: | |
| def minOperationsMaxProfit(self, customers: List[int], boardingCost: int, runningCost: int) -> int: | |
| CAPACITY = 4 | |
| NO_PROFIT = -1 | |
| numCustomersWaiting = 0 | |
| totalCustomers = 0 |
| class Solution: | |
| def reorderLogFiles(self, logs: List[str]) -> List[str]: | |
| def get_key(log): | |
| _id, rest = log.split(" ", maxsplit=1) | |
| return (0, rest, _id) if rest[0].isalpha() else (1, ) | |
| return sorted(logs, key=get_key) |
| ''' | |
| https://leetcode.com/problems/serialize-and-deserialize-binary-tree/discuss/74259/Recursive-preorder-Python-and-C%2B%2B-O(n) | |
| ''' | |
| class Codec: | |
| def serialize(self, root): | |
| def doit(node): | |
| if node: | |
| vals.append(str(node.val)) | |
| doit(node.left) |
Create ~/.tmux.conf
touch ~/.tmux.confEnter:
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:
This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Base box: https://github.com/akrabat/packer-templates | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "19ft/windows2016" | |
| config.vm.guest = :windows | |
| config.vm.boot_timeout = 600 |
| { | |
| "project_name": "Index", | |
| "author": "Anonymous" | |
| } |