This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 2D Matrix Ops | |
import sys | |
from functools import partial | |
# SLICING | |
""" | |
=> operates on SHALLOW REFERENCE PTR to COMPLEX types (like list, array); | |
OR actual VALUES of PRIMITIVE types (like char, int) | |
- https://www.python-course.eu/deep_copy.php | |
a[start:end] # items start through end-1 (ie NOT inclusive of END) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# calculate 1D stats on data | |
data = [10, 2, 38, 23, 21, 5, 38, 23] | |
# sum | |
dataSum = sum (data) | |
print ('sum is: {}'.format(dataSum)) | |
# COUNT | |
count = len (data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
PROBLEM: | |
4-digit number: 2284 | |
- assume have dictionary isWord(String word) | |
- assume have phonenum pad digit to set of letters | |
- print all possible words of ANY length up to 4-digits | |
eg 2->A,B,C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build an N-Tree from 2D array of Parent-Child pairs | |
import logging | |
from collections import deque | |
""" | |
TREE: | |
3 | |
/ | \ | |
4 5 6 |
OlderNewer