Programing Portfolio

Contact:

scott.sattler.dev@gmail.com  // TODO: get TLD

Certifications:

Certified Associate in Python Programming
Certified Entry-Level Python Programmer
CompTIA A+  // TODO:

Coursework:

CS50: Introduction to Computer Science
6.034: Artificial Intelligence

Relative Competency (highest to lowest):

Python, C#, HTML/CSS/JS, SQL, R

GitHub:

https://github.com/scott-sattler

Quick Links:

RESUME
Unit Testing Demonstration


                    
"""
Given an integer array nums and an integer k, return the k most frequent elements, in any order.
"""

class Solution:
    def topKFrequent(self, nums: List[int], k: int) -> List[int]:
        # create frequency map
        freq_m = dict()
        for num in nums:
            freq_m[num] = 1 + freq_m.get(num, 0)

        # heapify for k O(log2 n) pops
        import heapq
        freq_list = [(-v, k) for k, v in list(freq_m.items())]
        heapq.heapify(freq_list)  # O(n) < O(k log2 n)

        # pop k times for O(k log2 n) complexity
        top_k = list()
        for _ in range(k):
            top_k.append(heapq.heappop(freq_list))

        return [k for v, k in top_k]  # return only relevant data
                        
                    
live solutions

https://leetcode.com/scott_sattler/

  • pick an image file to upload
  • select a pixel on that image
  • receive the name of the selected color