professional-info
personal-info
hobbies-info
contacts
find-me-also-in
professional-info / experience

I have a background in game development where I worked at a coding academy called Code Ninjas. I taught young students from the ages of 5 to 15 the basics of coding and game development. I also have experience in web development where I worked with a team of other university students in the 'Calgary Solar Car Club' where I developed their telemetry site and inventory portal.

Code snippet showcase:

@justin-phxm
Created 2 months ago

102. Binary Tree Level Order Traversal.py

Trees and Dequeues
class Solution: def levelOrder(self, root: Optional[TreeNode]) -> List[List[int]]: sol = [] q = deque([TreeNode(0, root)]) while q: nextQ = deque() while q: node = q.popleft() if node.left: nextQ.append(node.left) if node.right: nextQ.append(node.right) if nextQ: sol.append([node.val for node in nextQ]) q = nextQ return sol
@justin-phxm
Created 2 months ago

150. Evaluate Reverse Polish Notation.py

Stack and functions as values
class Solution: def evalRPN(self, tokens: List[str]) -> int: myStack = [] def add(a, b): return a + b def sub(a, b): return a - b def mult(a, b): return a * b def div(a, b): return int(a / b) operators = { '+': add, '-': sub, '*': mult, '/': div } for tok in tokens: if tok not in operators: myStack.append(int(tok)) else: b, a = myStack.pop(), myStack.pop() result = operators[tok](a, b) myStack.append(result) return myStack[0]
@justin-phxm
Created 2 months ago

973. K Closest Points to Origin.py

973. K Closest Points to Origin
class Solution: def kClosest(self, points: List[List[int]], k: int) -> List[List[int]]: def dist(x, y): return (x**2+y**2)**0.5 return sorted(points, key=lambda p:dist(*p))[:k]
@justin-phxm
Created 36 months ago

Game.tsx

Fisher-Yates Shuffle Algorithm
function shuffleArray(array: number[][]) { const newBoard = [...array]; for (var y = array.length - 1; y > 0; y--) { for (var x = array[0].length - 1; x > 0; x--) { var j = Math.floor(Math.random() * (y + 1)); var k = Math.floor(Math.random() * (x + 1)); var temp = array[j][k]; newBoard[j][k] = array[y][x]; newBoard[y][x] = temp; } }
@justin-phxm
Created 36 months ago

pascalTriangle.py

Pascal's Triangle
from math import * class Solution: def generate(self, numRows: int) -> List[List[int]]: myArray = [] for row in range(numRows): rowArray = [] for col in range(row+1): combination = factorial(row) / (factorial(col) * factorial(row - col)) rowArray.append(int(combination)) myArray.append(rowArray) return myArray